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

Automatically terminate internal C*AS query on DROP STREAM|TABLE #5987

Closed
spena opened this issue Aug 12, 2020 · 1 comment
Closed

Automatically terminate internal C*AS query on DROP STREAM|TABLE #5987

spena opened this issue Aug 12, 2020 · 1 comment
Assignees
Milestone

Comments

@spena
Copy link
Member

spena commented Aug 12, 2020

Is your feature request related to a problem? Please describe.

Partial request for KLIP-20: Remove TERMINATE:

tl;dr: Requiring users to TERMINATE a persistent query before dropping a source causes friction in 
the user experience. The id of the query(s) that need terminating are not determinism or accessible 
through SQL. We propose dropping the source should automatically drop persistent query(s) that 
write to it.

This feature request is part of the ksqlDB migrations to allow users to drop streams and tables from SQL scripts. Users cannot access the query ID from SQL scripts, so it is impossible to do ksqlDB migrations without it.

Describe the solution you'd like

DROP STREAM <stream> | TABLE <table> should terminate the internal persistent query running in the background without requiring the user to call the TERMINATE command.

Constraints
If another query (stream/table or insert/select) is reading or writing on the same stream/table, then the DROP command should fail and not allow the user to terminate and drop the stream. This is a similar behavior from other DBs systems when having a foreign key constraint between tables. If one table has a reference, then dropping the table is not possible until the other table is dropped too.

This should avoid the issues mentioned in the KLIP-20:

We cannot drop a stream/table if a query is writing into it. Otherwise we will have queries that write 
into zombie stream/tables!

Describe alternatives you've considered

The current alternative is to use TERMINATE to terminate the query, then call DROP to drop the stream or table. But ksqlDB migrations are not possible with this.

Additional context

Similar requests:

@spena
Copy link
Member Author

spena commented Aug 31, 2020

Marking this as duplicate. Will track the work in #2177

@spena spena closed this as completed Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants