KAFKA-7837: Ensure we do not shrink ISR for offline partitions#6202
Merged
junrao merged 1 commit intoapache:trunkfrom Jan 26, 2019
Merged
KAFKA-7837: Ensure we do not shrink ISR for offline partitions#6202junrao merged 1 commit intoapache:trunkfrom
junrao merged 1 commit intoapache:trunkfrom
Conversation
Member
|
Thanks for the PR. It's good to include details in the PR description about fixes like this. |
junrao
approved these changes
Jan 26, 2019
Contributor
junrao
left a comment
There was a problem hiding this comment.
@dhruvilshah3 : Thanks for the patch. LGTM
jarekr
pushed a commit
to confluentinc/kafka
that referenced
this pull request
Apr 18, 2019
* ak/trunk: MINOR: Update usage of deprecated API (apache#6146) KAFKA-4217: Add KStream.flatTransform (apache#5273) MINOR: Update Gradle to 5.1.1 (apache#6160) KAFKA-3522: Generalize Segments (apache#6170) Added quotes around the class path (apache#4469) KAFKA-7837: Ensure offline partitions are picked up as soon as possible when shrinking ISR (apache#6202) MINOR: In the MetadataResponse schema, ignorable should be a boolean KAFKA-7838: Log leader and follower end offsets when shrinking ISR (apache#6168) KAFKA-5692: Change PreferredReplicaLeaderElectionCommand to use Admin… (apache#3848) MINOR: clarify why suppress can sometimes drop tombstones (apache#6195) MINOR: Upgrade ducktape to 0.7.5 (apache#6197) MINOR: Improve IntegrationTestUtils documentation (apache#5664) MINOR: upgrade to jdk8 8u202 KAFKA-7693; Fix SequenceNumber overflow in producer (apache#5989) KAFKA-7692; Fix ProducerStateManager SequenceNumber overflow (apache#5990) MINOR: update copyright year in the NOTICE file. (apache#6196) KAFKA-7793: Improve the Trogdor command line. (apache#6133)
pengxiaolong
pushed a commit
to pengxiaolong/kafka
that referenced
this pull request
Jun 14, 2019
…le when shrinking ISR (apache#6202) Check if a partition is offline while iterating all partitions. Reviewers: Jun Rao <junrao@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a partition is marked offline due to a failed disk, the leader is supposed to not shrink its ISR any more. In
ReplicaManager#maybeShrinkIsr, we iterate through all non-offline partitions to shrink the ISR. If an ISR needs to shrink, we need to write the new ISR to ZK, which can take a bit of time. In this window, some partitions could now be marked as offline, but may not be picked up by the iterator. This is because the offline partition iterator used inReplicaManager#maybeShrinkIsris weakly consistent and does not necessarily reflect the updated offline state.This patch fixes the above issue by iterating through all topic partitions and checking whether the partition has been made offline within the iteration. This helps ensure we detect a partition being made offline during the iteration and prevent ISRs from shrinking thereof.