HOTFIX: skip listOffsets request for newly created changelog topics#8662
Conversation
|
call for review any of @guozhangwang @vvcephei @cadonna @mjsax |
There was a problem hiding this comment.
Am I crazy or is this entire block not actually doing anything?
There was a problem hiding this comment.
It should do some sanity checks -- but I agree it's not easy to grok... Maybe we also incrementally refactored the code and this method become useless? All tests passed?
There was a problem hiding this comment.
I guess to be fair it was still validating that every topic had the numberOfPartitions set, but I thought it might make more sense to do this inside the InternalTopicManager since that checks the partitions anyways
There was a problem hiding this comment.
The logic indeed seem redundant to me.
|
Retest this please |
There was a problem hiding this comment.
I like immutability. Should we call this allExpetcedChangelogPartitions and introduce allExistingChangelogPartitions = allExpetcedChangelogPartitions - newlyCreatedChangelogs
mjsax
left a comment
There was a problem hiding this comment.
Overall LGTM.
Can we extend unit test accordingly to verify that we set offset=0L for newly created topcis?
|
@mjsax addressed your comments and added a unit test to verify that we don't ask the admin client to request offsets for newly created topics |
There was a problem hiding this comment.
Don't we need to reply adminClient, too?
There was a problem hiding this comment.
It gets replayed during configuration (at the end of configureDefault below)
|
Retest this please |
|
Retest this please |
6b7d183 to
fbc13b4
Compare
|
Retest this please. |
1 similar comment
|
Retest this please. |
|
Nooooooo But it failed on a different line which seems more in line with real flakiness. FWIW I ran this locally 40 times without failures (technically 80 in total for both true/false variations) ... I think it's worth still merging this PR and we can continue investigating it from there. |
vvcephei
left a comment
There was a problem hiding this comment.
Oops, never submitted my review. Feel free to ignore my minor suggestion.
There was a problem hiding this comment.
It's not what you signed up for, but I'm wondering if we should at least submit a Jira to give some of these AdminClient methods a "full consistency" mode. In other words, since the command returns a future anyway, it would be nice to be able to tell it not to return until it can guarantee the topic will appear to be fully created on all brokers.
I'm mildly concerned that we're just kicking the can down the road a little ways with this PR. I.e., we let the assignment happen, but then some other metadata (or data) operation for that topic will just fail shortly thereafter.
More generally, we jump through a lot of hoops in our own tests to try and make sure that the topics are really, actually created (or deleted) before proceeding with the test, and I'm sure that our users also suffer from the same problem in their testing and production code.
There was a problem hiding this comment.
I think this race condition was particularly severe since we do the listOffsets request pretty much immediately after creating the topics, whereas whatever we're doing with that topic next will not be until the rebalance was completed.
AFAIK we've never had any users report subsequent operations failing after the first rebalance due to not-yet-fully-created topics, but it could have just slipped past us
There was a problem hiding this comment.
I do agree it would be useful though. Feel free to create a ticket :P
There was a problem hiding this comment.
Thanks! Will do. I just wanted to bounce the idea off you first, in case it was stupid.
Co-authored-by: John Roesler <vvcephei@users.noreply.github.com>
|
Retest this please. |
1 similar comment
|
Retest this please. |
|
Java 14 build passed, Java 8 din't build due to |
|
Thanks, @ableegoldman ! |
This seems to be the final piece in the EosBetaUpgradeTest flakiness puzzle. From time to time the listOffsets request would fail during the initial startup rebalance, causing a probing rebalance to be scheduled for 10 min later (rather than immediately after). The assignor was newly creating the changelogs and then almost immediately calling
listOffsetswhich then failed as the internal topics were not yet ready.To avoid this race condition, we keep track of which changelogs we just created and skip fetching the end offsets for them. If a changelog did not exist before this moment, we can safely assume that its end offset is zero.