Skip to content

KAFKA-9839; Broker should accept control requests with newer broker epoch#9150

Closed
viktorsomogyi wants to merge 1 commit intoapache:2.2from
viktorsomogyi:KAFKA-9839-2.2
Closed

KAFKA-9839; Broker should accept control requests with newer broker epoch#9150
viktorsomogyi wants to merge 1 commit intoapache:2.2from
viktorsomogyi:KAFKA-9839-2.2

Conversation

@viktorsomogyi
Copy link
Copy Markdown
Contributor

This is a backport of #8509.

A broker throws IllegalStateException if the broker epoch in the LeaderAndIsr/UpdateMetadataRequest/StopReplicaRequest is larger than its current broker epoch. However, there is no guarantee that the broker would receive the latest broker epoch before the controller: when the broker registers with ZK, there are few more instructions to process before this broker "knows" about its epoch, while the controller may already get notified and send UPDATE_METADATA request (as an example) with the new epoch. This will result in clients getting stale metadata from this broker.

With this PR, a broker accepts LeaderAndIsr/UpdateMetadataRequest/StopReplicaRequest if the broker epoch is newer than the current epoch.

Reviewers: David Jacot djacot@confluent.io, Jason Gustafson jason@confluent.io

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@viktorsomogyi
Copy link
Copy Markdown
Contributor Author

@apovzner @hachikuji would you please review this backport?
And while I'm at it, I can backport these onto the 2.3 and 2.4 lines as well.

…poch (apache#8509)

A broker throws IllegalStateException if the broker epoch in the LeaderAndIsr/UpdateMetadataRequest/StopReplicaRequest is larger than its current broker epoch. However, there is no guarantee that the broker would receive the latest broker epoch before the controller: when the broker registers with ZK, there are few more instructions to process before this broker "knows" about its epoch, while the controller may already get notified and send UPDATE_METADATA request (as an example) with the new epoch. This will result in clients getting stale metadata from this broker.

With this PR, a broker accepts LeaderAndIsr/UpdateMetadataRequest/StopReplicaRequest if the broker epoch is newer than the current epoch.

Reviewers: David Jacot <djacot@confluent.io>, Jason Gustafson <jason@confluent.io>
@viktorsomogyi
Copy link
Copy Markdown
Contributor Author

viktorsomogyi commented Aug 10, 2020

2.3: #9151
2.4: #9152

@viktorsomogyi
Copy link
Copy Markdown
Contributor Author

@dajac pinging you as well, would you please review this and the 2.3 and 2.4 backports? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants