Skip to content

Conversation

@log-head
Copy link
Contributor

This patch fails a db-level changefeed when its watched database is dropped.

Epic: CRDB-55919
Fixes: #156780

Release note (sql change): A database-level changefeed will now fail when its watched database is dropped.

@blathers-crl
Copy link

blathers-crl bot commented Dec 10, 2025

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@log-head
Copy link
Contributor Author

Just the last commit needs review.
This depends on #159199, which in turn depends on two open PRs #156771 #156874

@log-head log-head force-pushed the log-head/db-level-changefeed-dropped-db branch from e79b7a6 to dc55dfb Compare December 15, 2025 22:01
@log-head log-head requested a review from aerfrei December 16, 2025 17:09
If you specify a table in a database-level
changefeed that's in another database, it will
return a terminal error instead of an
assertion-failed error.

Epic: None
Release note: None
Previously the tableset watcher would incorrectly
report table drops for databases and schemas. This is now fixed.

Epic: none
Release note: None
Add a table watcher check to the change frontier
before saving progress. If we encounter a new
table, save progress up to that point and then
die.

Fixes: cockroachdb#148834
Release note: None
Use filters from changefeed details to filter tables in db-level feeds.

Fixes: cockroachdb#156859
Release note: None
@log-head log-head force-pushed the log-head/db-level-changefeed-dropped-db branch 2 times, most recently from 32c5a2b to a4adfed Compare December 17, 2025 15:25
@log-head
Copy link
Contributor Author

@andyyang890 and I discussed instead checking for the database drop in the schema feed. One issue with this is that polling and validating table descriptors is paused when schema locked is active. So while schema locked is active, this wouldn't be running to check if the database has been dropped. So, I'm going to keep checking in the tableset watcher for the database drop. Additionally, this works in the case of the changefeed hibernating while there's an empty tableset, since there will be a watcher running but not a schema feed.

@log-head log-head changed the title changefeedccl: db-level feeds: fail the feed if the watched db is dropped changefeedccl: db-level feeds: fail the feed if the watched db is dropped/renamed Dec 17, 2025
…pped

This patch fails a db-level changefeed when its watched database is
dropped.

Epic: CRDB-55919
Fixes: cockroachdb#156780

Release note (sql change): A database-level changefeed will now fail
when its watched database is dropped.
@log-head log-head force-pushed the log-head/db-level-changefeed-dropped-db branch from a4adfed to 5bef842 Compare December 24, 2025 20:44
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.

changefeedccl: db-level feeds: fail the feed if the watched db is dropped

3 participants