Skip to content

KAFKA-10198: guard against recycling dirty state#8924

Merged
guozhangwang merged 3 commits intoapache:trunkfrom
ableegoldman:10198-add-closeclean-guard-tocloseAndRecycleState
Jun 25, 2020
Merged

KAFKA-10198: guard against recycling dirty state#8924
guozhangwang merged 3 commits intoapache:trunkfrom
ableegoldman:10198-add-closeclean-guard-tocloseAndRecycleState

Conversation

@ableegoldman
Copy link
Copy Markdown
Member

@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
Copy Markdown
Member 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
Copy Markdown
Member

mjsax commented Jun 24, 2020

Retest this please.

@guozhangwang
Copy link
Copy Markdown
Contributor

LGTM.

Copy link
Copy Markdown
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
Copy Markdown
Member 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
Copy Markdown
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