-
Notifications
You must be signed in to change notification settings - Fork 1k
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: don't use queryId of last terminate command after restore #6278
Conversation
e6c42e1
to
3a2aa62
Compare
@vpapavas can you try this test scenario? I'm not sure this is fixing the issue. Delete any existing command topic
Stop the server. Start the server up.
I think even with this change, we'd duplicate the |
There was a problem hiding this 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 Vicky! The test coverage gives me more confidence that this works.
The change, however, I think is fixing the issue with a band-aid instead of fixing it at the root. We're adding more edge cases to the code and making the queryID generation more difficult to reason about. I think we should look for another solution that simplifies queryID generation instead of adding more conditions. Let's chat offline if you need some help coming up with solutions.
...st-app/src/main/java/io/confluent/ksql/rest/server/computation/RestoreCommandsCompactor.java
Outdated
Show resolved
Hide resolved
...st-app/src/main/java/io/confluent/ksql/rest/server/computation/RestoreCommandsCompactor.java
Outdated
Show resolved
Hide resolved
...pp/src/main/java/io/confluent/ksql/rest/server/computation/InteractiveStatementExecutor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It looks like you accidentally left some of the previous commit's work (handleRestore
). Just for anyone reading this discussion, I have thought about whether this is backwards compatible and i think it is because any old commands that used the old numbering (e.g. the first query was always _0
) will have their queryIds persisted. It might break some people's automated tests in the worst case
ksqldb-rest-app/src/test/java/io/confluent/ksql/rest/server/computation/CommandRunnerTest.java
Outdated
Show resolved
Hide resolved
ksqldb-rest-app/src/test/java/io/confluent/ksql/rest/server/computation/RecoveryTest.java
Show resolved
Hide resolved
90366a1
to
ae22c04
Compare
Description
Fixes #6010
The problem is that if the last command before a restart was a terminate, then the first command after the restart gets the same queryId as the terminate. Moreover, if the command topic contains only terminate commands, the next queryId will be 0. To avoid this, we always increase the queryId for every command, whether it has a plan or not
Testing done
Unit tests.
Manual testing
Restart
Reviewer checklist