KAFKA-8649: send latest commonly supported version in assignment#7423
KAFKA-8649: send latest commonly supported version in assignment#7423guozhangwang merged 9 commits intoapache:trunkfrom
Conversation
|
Not sure if we need any additional changes to At some point we definitely do want to make some adjustments to |
guozhangwang
left a comment
There was a problem hiding this comment.
This PR looks great to me, and I like the cleanup a lot! Just some minor comments.
There was a problem hiding this comment.
Now it seems all constructors would trigger the version check anyways, so shall we just move this in to the last constructor (with 6 params)?
There was a problem hiding this comment.
nit: maybe rename the field in AssignmentInfo as minSupportedVersion -- or commonlySupportedVersion is also fine -- and also rename the access function names as well as the local fields here? I felt latestSupportedVersion is becoming confusing now.
There was a problem hiding this comment.
Yeah I kept flip-flopping on what I thought a good name would be -- happy to just go with commonlySupportedVersion
There was a problem hiding this comment.
If receivedAssignmentMetadataVersion < EARLIEST_PROBEABLE_VERSION, it is also a pretty bad situation since it means that the leader is too old to even be covered with version probing --- in fact, if it is that old, upon getting the new version it would throw exception and die immediately, so we'd not even see the assignment back at all --- so we'd better also log it as an ERROR to complete the logic.
There was a problem hiding this comment.
True, we should actually check for this (in validateMetadataVersions) and throw an exception -- it basically means someone tried to do a rolling bounce from < 2.0 without setting the UPGRADE_FROM config
There was a problem hiding this comment.
Actually, this would not be an error but possibly just an upgrade from a very old version -- see #7436
There was a problem hiding this comment.
I'd suggest adding some javadoc here explaining our logic:
latestCommonlySupportedVersion belongs to [usedSubscriptionMetadataVersion, LATEST_SUPPORTED_VERSION]
receivedAssignmentMetadataVersion belongs to [EARLIEST_PROBEABLE_VERSION, usedSubscriptionMetadataVersion]
usedSubscriptionMetadataVersion would be upgraded to latestCommonlySupportedVersion when necessary.
There was a problem hiding this comment.
We can collapse these two into a single private function.
|
|
…e client's prevTasks to each consumer
b850496 to
1fa7003
Compare
fix system test (hopefully...)
6150c5d to
1afc31f
Compare
There was a problem hiding this comment.
This error message didn't make sense, it should be referring to upgrading the metadata to the newer version
set leader counter
72f10aa to
6b7ea3c
Compare
| monitors[first_other_processor] = first_other_monitor | ||
| monitors[second_other_processor] = second_other_monitor | ||
|
|
||
| leader_monitor.wait_until("Received a future (version probing) subscription (version: 6). Sending empty assignment back (with supported version 5).", |
There was a problem hiding this comment.
I'm +1 on removing this logic, we could not assume that the leader did not change even if it is not the one who get's bounced, since it may join the group late.
|
Failed JDK 11 and Scala 2.12, JDK 8 and Scala 2.11 on different tests (one for each run), no overlapping on the fail test. |
|
The PR LGTM, merging to trunk. |
Small follow-up to trunk PR #7423 While debugging the 2.3 VP PR we realized we should remove the leader-tracking from the VP system test altogether. We'd already merged the corresponding trunk PR so I made a quick new PR for trunk (also fixes a missed version bump in one of the log messages) Reviewers: Guozhang Wang <wangguoz@gmail.com>
...instead of sending the leader's version and having older members try to blindly upgrade.
The only other real change here is that we will also set the
VERSION_PROBINGerror code and return early fromonAssignmentwhen we are upgrading our used subscription version (not just downgrading it) since this implies the whole group has finished the rolling upgrade and all members should rejoin with the new subscription version.Also piggy-backing on a fix for a potentially dangerous edge case, where every thread of an instance is assigned the same set of active tasks.
Should be cherry-picked back to 2.1
2.4/trunk: this PR
2.3: PR #7425
2.2: PR #7426
2.1: PR #7427