fix(meta): clean dropped table change logs and watermarks - #26413
Merged
Merged
Conversation
zwang28
approved these changes
Jul 23, 2026
Contributor
|
✅ Cherry-pick PRs (or issues if encountered conflicts) have been created successfully to all target branches. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Dropping a subscription can mark its table change log for complete garbage
collection. The meta-store deletion path previously represented this operation
with
u64::MAX, then cast it to the signed meta-modelEpochtype. The castproduced
-1, so the resultingcheckpoint_epoch < -1predicate matched norows and left the table's change log permanently orphaned.
This PR:
Represents complete table change-log deletion explicitly and deletes all rows
for the affected table, while preserving epoch-based truncation for active
tables.
Removes table watermarks for every table in
removed_table_ids, includingdrops that carry no new watermark update.
Adds a unit test covering watermark removal when applying a Hummock version
delta.
Closes Bug:
hummock_table_change_logaccumulates orphaned rows permanently after subscription drop, causing meta leader degradation #26011Validation
cargo fmt --checkgit diff --check main...HEADCARGO_PROFILE_DEV_DEBUG=0 CARGO_BUILD_JOBS=1 cargo test -p risingwave_hummock_sdk --lib test_apply_version_delta_removes_dropped_table_watermarkCARGO_PROFILE_DEV_DEBUG=0 CARGO_BUILD_JOBS=1 cargo clippy --all-targets --all-featuresChecklist
Documentation
No user documentation update is required. The operational impact is covered by
the release note below.
Release note
Dropping subscriptions and watermark-bearing materialized views now cleans up
their associated Hummock change-log and watermark metadata, preventing orphaned
metadata from accumulating in the meta database.