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

fix: During ksql startup, avoid recreating deleted command topic when a valid backup exists #7753 #8257

Merged

Conversation

mkandaswamy
Copy link
Member

@mkandaswamy mkandaswamy commented Oct 14, 2021

Description

Fixes #7753
During ksql startup, avoid recreating deleted command topic when a valid backup exists.

Earlier, regardless of backup file we used to recreate deleted command topic during ksql startup(which will be out of sync with existing backup). This delays detection of the problem until a new query is issued to ksql server which subsequently will enter DEGRADED status.

With this change, deleted command topics won't be recreated once a valid backup is found and the ksql server will be put on DEGRADED status immediately during the startup process.

Testing done

Unit, integration test and manual verification

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@mkandaswamy mkandaswamy requested a review from a team as a code owner October 14, 2021 07:28
@mkandaswamy mkandaswamy changed the title fix: Avoid recreating command topic when it has been deleted and a valid backup exists. #7753 [DRAFT] fix: Avoid recreating command topic when it has been deleted and a valid backup exists. #7753 Oct 14, 2021
@mkandaswamy mkandaswamy changed the title [DRAFT] fix: Avoid recreating command topic when it has been deleted and a valid backup exists. #7753 fix: During ksql startup, avoid recreating deleted command topic when a valid backup exists #7753 Oct 15, 2021
…anges into its own test file: QuickDegradeAndRestoreCommandTopicIntegrationTest
KsqlRestoreCommandTopic.main(
new String[]{
"--yes",
"-s",
Copy link
Member

Choose a reason for hiding this comment

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

This flag isn't necessary, this flag is for skipping incompatible commands when restoring the command topic

Copy link
Member Author

Choose a reason for hiding this comment

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

ah ok, will remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@stevenpyzhang stevenpyzhang left a comment

Choose a reason for hiding this comment

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

lgtm, left one comment


// Then
assertThat(TEST_HARNESS.topicExists(commandTopic), is(false));
assertThatEventually("Degraded State", this::isDegradedState, is(true));
Copy link
Member

@stevenpyzhang stevenpyzhang Oct 18, 2021

Choose a reason for hiding this comment

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

Can we switch the order of these two statements? I'm not sure the check for the command topic will happen before the server has fully started up and skipped over any parts that may create a command topic. (I don't think .start() is blocking)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Swapped the order of two statements.

@mkandaswamy mkandaswamy merged commit f3f1d5c into confluentinc:master Oct 20, 2021
@mkandaswamy mkandaswamy deleted the fix_auto_recreating_cmd_topic branch October 20, 2021 21:26
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.

Avoid creating command topic when backup file exists
2 participants