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: don't cleanup topics on engine close #4658

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

agavra
Copy link
Contributor

@agavra agavra commented Feb 27, 2020

Co-authored-by: Rohan [email protected]

fixes #4654

Description

See the description in the ticket above. This makes it so that we don't cleanup topics for persistent queries on closing the engine (but we do for transient).

Testing done

  • Unit tests
  • Manual testing to ensure we can't reproduce the bug.

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

@agavra agavra force-pushed the fix-topic-deletion-on-exit branch 2 times, most recently from 876a543 to 7c7a222 Compare February 27, 2020 17:46
Comment on lines 183 to 185
public void stop() {
close(false);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be tempted to make this abstract and move this impl to PersistentQuery.

No biggie, just feels cleaner to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to do that, but there's a place where QueryMetadata is actually being instantiated directly. Not sure if that's a bug, but I didn't want to deal with it now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Really? Sounds like a bug!

Copy link
Contributor

@big-andy-coates big-andy-coates Feb 27, 2020

Choose a reason for hiding this comment

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

Looks like this is used from the new API code: for transient queries. So this should default to cleaning up internal topics.

Copy link
Contributor

Choose a reason for hiding this comment

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

so we should switch this to close(true) as we want transient queries to delete internal state.

This will also mean we need to remove the overloaded version from TransientQueryMetadata and add the following overload to PersistentQueryMetadata

@Override
public void stop() {
    close(false);
  }

@agavra agavra force-pushed the fix-topic-deletion-on-exit branch 3 times, most recently from de929b1 to d237f85 Compare February 27, 2020 18:11
@agavra agavra requested a review from rodesai February 27, 2020 18:15
Copy link
Contributor

@big-andy-coates big-andy-coates left a comment

Choose a reason for hiding this comment

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

LGTM!

Co-authored-by: Rohan <[email protected]>
Co-authored-by: Andy Coates <[email protected]>
@agavra agavra force-pushed the fix-topic-deletion-on-exit branch from d237f85 to 0b52ace Compare February 27, 2020 18:30
@agavra agavra marked this pull request as ready for review February 27, 2020 18:30
@agavra agavra requested a review from a team as a code owner February 27, 2020 18:30
@agavra agavra changed the base branch from master to 5.5.x February 27, 2020 18:30
@agavra agavra force-pushed the fix-topic-deletion-on-exit branch from 7dfb722 to f52591d Compare February 27, 2020 19:20
@agavra agavra merged commit a8ecb72 into confluentinc:5.5.x Feb 27, 2020
@agavra agavra deleted the fix-topic-deletion-on-exit branch February 27, 2020 20:06
colinhicks pushed a commit that referenced this pull request Feb 27, 2020
colinhicks pushed a commit that referenced this pull request Feb 27, 2020
agavra added a commit to agavra/ksql that referenced this pull request Feb 27, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 4, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 4, 2020
stevenpyzhang added a commit that referenced this pull request Mar 6, 2020
* fix: idempotent terminate that can handle hung streams (#4643)

Fixes a couple issues with terminate:
- don't throw if the query doesn't get into NOT_RUNNING state. This can
  happen when streams threads are stuck pending shutdown.
- make terminate idempotent

* fix: don't cleanup topics on engine close (#4658)

Co-authored-by: Rohan <[email protected]>
Co-authored-by: Andy Coates <[email protected]>

Co-authored-by: Rohan <[email protected]>
Co-authored-by: Almog Gavra <[email protected]>
Co-authored-by: Andy Coates <[email protected]>
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 18, 2020
stevenpyzhang added a commit that referenced this pull request Mar 20, 2020
* fix: idempotent terminate that can handle hung streams (#4643)

Fixes a couple issues with terminate:
- don't throw if the query doesn't get into NOT_RUNNING state. This can
  happen when streams threads are stuck pending shutdown.
- make terminate idempotent

* fix: don't cleanup topics on engine close (#4658)

Co-authored-by: Rohan <[email protected]>
Co-authored-by: Andy Coates <[email protected]>

Co-authored-by: Rohan <[email protected]>
Co-authored-by: Almog Gavra <[email protected]>
Co-authored-by: Andy Coates <[email protected]>
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 20, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 20, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 23, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 23, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 24, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 24, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 24, 2020
stevenpyzhang pushed a commit to stevenpyzhang/ksql that referenced this pull request Mar 24, 2020
stevenpyzhang added a commit that referenced this pull request Mar 26, 2020
Co-authored-by: Rohan <[email protected]>
Co-authored-by: Andy Coates <[email protected]>

Co-authored-by: Almog Gavra <[email protected]>
Co-authored-by: Rohan <[email protected]>
Co-authored-by: Andy Coates <[email protected]>
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.

KSQL sometimes deletes internal topics when the server shuts down
2 participants