Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-10198: guard against recycling dirty state #8924

Conversation

ableegoldman
Copy link
Contributor

@ableegoldman ableegoldman commented Jun 24, 2020

We just needed to add the check in StreamTask#closeClean to closeAndRecycleState as well. I also renamed closeAndRecycleState to closeCleanAndRecycleState to drive this point home: it needs to be clean.

This should be cherry-picked back to the 2.6 branch

/**
* You must commit a task and checkpoint the state manager before closing as this will release the state dir lock
*/
private void close(final boolean clean) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff turned out a bit awkward, basically I just factored this check out into a separate method that we should call at the beginning of both flavors of clean close

@mjsax mjsax added the streams label Jun 24, 2020
@mjsax
Copy link
Member

mjsax commented Jun 24, 2020

Retest this please.

@guozhangwang
Copy link
Contributor

LGTM.

Copy link
Contributor

@vvcephei vvcephei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, and for the test coverage, @ableegoldman !

@ableegoldman
Copy link
Contributor Author

Two unrelated test failures:
MirrorConnectorsIntegrationTest.testReplication
DynamicBrokerConfigTest > testPasswordConfigEncoderSecretChange

@guozhangwang guozhangwang merged commit 3348fc4 into apache:trunk Jun 25, 2020
guozhangwang pushed a commit that referenced this pull request Jun 25, 2020
We just needed to add the check in StreamTask#closeClean to closeAndRecycleState as well. I also renamed closeAndRecycleState to closeCleanAndRecycleState to drive this point home: it needs to be clean.

This should be cherry-picked back to the 2.6 branch

Reviewers: Matthias J. Sax <matthias@confluent.io>, John Roesler <john@confluent.io>, Guozhang Wang <wangguoz@gmail.com>,
@guozhangwang
Copy link
Contributor

Merged to trunk and cherry-picked to 2.6

@ableegoldman ableegoldman deleted the 10198-add-closeclean-guard-tocloseAndRecycleState branch June 26, 2020 22:40
Kvicii pushed a commit to Kvicii/kafka that referenced this pull request Jun 27, 2020
* 'trunk' of github.com:apache/kafka:
  KAFKA-10180: Fix security_config caching in system tests (apache#8917)
  KAFKA-10173: Fix suppress changelog binary schema compatibility (apache#8905)
  KAFKA-10166: always write checkpoint before closing an (initialized) task (apache#8926)
  MINOR: Rename SslTransportLayer.State."NOT_INITALIZED" enum value to "NOT_INITIALIZED"
  MINOR: Update Scala to 2.13.3 (apache#8931)
  KAFKA-9076: support consumer sync across clusters in MM 2.0 (apache#7577)
  MINOR: Remove Diamond and code code Alignment (apache#8107)
  KAFKA-10198: guard against recycling dirty state (apache#8924)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants