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

feat: CommandRunner enters degraded states when it processes command with higher version than it supports #6032

Conversation

stevenpyzhang
Copy link
Member

@stevenpyzhang stevenpyzhang commented Aug 17, 2020

Description

Stacks on top of
#6012
#6031

Review only last commit
Prevents the server from processing a command from a newer version than it. I've repurposed the Version flag added #5104 as it wouldn't find any use currently since we can't break backwards compatibility currently.

Testing done

Unit test
Manual test:

  • Start with fresh command topic
  • Start up server on this branch
  • Issue a bunch of statements to the command topic (CS/CSAS)
  • Stopped the server
  • Created a new branch and increment the VERSION in Command.java which is the ExpectedVersion
  • Start server and issue DDL statements
  • Switched to this branch and start up server
  • Verify with JConsole the CommandRunnerStatus is degraded
  • Verify all previous commands before the incompatible command are executed and the queries are started
  • Verify CommandRunner thread is shut down by trying to issue more DDL statements to server
create stream steven as select * from test;
DDL command failed to be sent to command topic, the CommandRunner is in a DEGRADED state currently.
This can happen when it encounters an incompatible command when processing the command topic.
Check the server logs for more details.

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 #")

@stevenpyzhang stevenpyzhang force-pushed the server-exception-on-new-commands branch 4 times, most recently from 7d12a66 to 55be881 Compare August 18, 2020 21:37
@stevenpyzhang stevenpyzhang force-pushed the server-exception-on-new-commands branch from 55be881 to a95cd49 Compare August 19, 2020 20:44
Copy link
Contributor

@rodesai rodesai left a comment

Choose a reason for hiding this comment

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

LGTM

@stevenpyzhang stevenpyzhang merged commit a841443 into confluentinc:master Aug 20, 2020
sarwarbhuiyan pushed a commit to sarwarbhuiyan/ksql that referenced this pull request Sep 4, 2020
…with higher version than it supports (confluentinc#6032)

* feat: move deserialization to CommandRunner and introduce DEGRADED to CommandRunnerStatus

* rohan comment

* fix test

* more feedback

* pass deserializer to queuedcommand for command

* chore: refactor DistributingExecutor to use CommandRunner instead of CommandQueue

* rohan comment

* feat: CommandRunner enters degraded states when it processes command with higher version than it supports
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.

None yet

2 participants