Skip to content

KAFKA-14299: Never transition to UpdateStandby twice#12762

Merged
cadonna merged 4 commits intoapache:trunkfrom
lucasbru:fix_invalidstate
Oct 19, 2022
Merged

KAFKA-14299: Never transition to UpdateStandby twice#12762
cadonna merged 4 commits intoapache:trunkfrom
lucasbru:fix_invalidstate

Conversation

@lucasbru
Copy link
Copy Markdown
Member

In two situations, the current code could transition the ChangelogReader
to UpdateStandby when already in that state, causing and
InvalidStateException. Namely these two cases are:

  1. When only standby tasks are restoring and one of them crashes.
  2. When only standby tasks are restoring and one of them is paused.

This change fixes both issues by only transitioning if the paused or
failed task is an active task.

Committer Checklist (excluded from commit message)

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

@lucasbru
Copy link
Copy Markdown
Member Author

@cadonna @guozhangwang

Could you have a look?
The test failures look unrelated.

Build / JDK 17 and Scala 2.13 / testTransactionAfterProducerIdExpires(String).quorum=zk – kafka.api.TransactionsExpirationTest
7s
Build / JDK 11 and Scala 2.13 / shouldWriteLatestOffsetsToCheckpointOnShutdown[exactly_once] – org.apache.kafka.streams.integration.EosIntegrationTest
12s
Build / JDK 11 and Scala 2.13 / testTaskRequestWithOldStartMsGetsUpdated() – org.apache.kafka.trogdor.coordinator.CoordinatorTest
2m 0s

Copy link
Copy Markdown
Member

@cadonna cadonna 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 PR, @lucasbru !

LGTM!

@cadonna
Copy link
Copy Markdown
Member

cadonna commented Oct 19, 2022

Build failures are unrelated

Build / JDK 11 and Scala 2.13 / kafka.api.TransactionsExpirationTest.testTransactionAfterProducerIdExpires(String).quorum=kraft

@cadonna cadonna merged commit 2c8f14c into apache:trunk Oct 19, 2022
guozhangwang pushed a commit to guozhangwang/kafka that referenced this pull request Jan 25, 2023
In two situations, the current code could transition the ChangelogReader
to UpdateStandby when already in that state, causing an IllegalStateException. 
Namely these two cases are:

1. When only standby tasks are restoring and one of them crashes.
2. When only standby tasks are restoring and one of them is paused.

This change fixes both issues by only transitioning if the paused or
failed task is an active task.

Reviewer: Bruno Cadonna <cadonna@apache.org>
rutvijmehta-harness pushed a commit to rutvijmehta-harness/kafka that referenced this pull request Feb 9, 2024
In two situations, the current code could transition the ChangelogReader
to UpdateStandby when already in that state, causing an IllegalStateException. 
Namely these two cases are:

1. When only standby tasks are restoring and one of them crashes.
2. When only standby tasks are restoring and one of them is paused.

This change fixes both issues by only transitioning if the paused or
failed task is an active task.

Reviewer: Bruno Cadonna <cadonna@apache.org>
rutvijmehta-harness added a commit to rutvijmehta-harness/kafka that referenced this pull request Feb 9, 2024
)

In two situations, the current code could transition the ChangelogReader
to UpdateStandby when already in that state, causing an IllegalStateException. 
Namely these two cases are:

1. When only standby tasks are restoring and one of them crashes.
2. When only standby tasks are restoring and one of them is paused.

This change fixes both issues by only transitioning if the paused or
failed task is an active task.

Reviewer: Bruno Cadonna <cadonna@apache.org>

Co-authored-by: Lucas Brutschy <lucasbru@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants