Uh oh!
There was an error while loading. Please reload this page.
[fix](cloud) Retain instance tombstones after recycle cleanup - #66870
Conversation
hello-stephen
commented
Aug 18, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
df66e7d to
8ae3c7cComparewyxxxcat
commented
Aug 18, 2026
/review |
There was a problem hiding this comment.
This PR makes the deleted-instance metadata cleanup and terminal recycle-state transition atomic, preserves forward-only successor gating, and adds useful direct unit coverage. However, I found three blocking lifecycle and compatibility issues and requested changes inline:
- Completed records remain in every active-instance range scan forever; ignored scan failures can leave later live or deleting instances unscheduled.
- Any terminal marker retained under the legacy instance key is unsafe for pre-upgrade meta-servers: old cache misses accept key existence and can recreate metadata, while full predecessor records also enable stale cache hits.
- Several mutating instance operations can now rewrite a DELETED/CLEANUP_COMPLETED record indefinitely.
Critical checkpoint conclusions:
- Goal and tests: Partially achieved. Retained completion state, immediate-successor gating, missing-successor compatibility, current-code cache clearing, and scanner queue filtering have direct tests; scale/partial-scan behavior, base-reader/current-writer restart, concurrent multi-hop chains, and post-terminal mutation are not covered.
- Scope and parallel paths: The code change is focused, but the lifecycle change was not propagated to all full-instance scanners or to a shared terminal-state mutation guard.
- Concurrency and lifecycle: Recycler queue/map locking and ResourceManager locking are sound. Recycle states are monotonic, and metadata deletion plus CLEANUP_COMPLETED commit atomically. The unresolved lifecycle problem is permanent records in the legacy active keyspace and mutable APIs.
- Configuration and compatibility: No new configuration is introduced. The existing watcher is asynchronous and disableable, so it cannot serve as a rolling-upgrade compatibility fence for older binaries.
- Persistence and data correctness: Successor ordering and retry/restart behavior are safe under the persisted chain invariant. Retaining the completion marker under the legacy instance key lets old writers recreate metadata after cleanup; retaining the full predecessor payload also enables stale cluster cache hits and terminal mutations.
- Performance and observability: Periodic reads, deserialization, allocation, and INFO logging now scale with all historically deleted tenants; partial full-range errors are ignored by scanner callers.
- Protocol and storage format: No FE/BE variable, RPC schema, or durable data-format change is introduced beyond the instance-record lifecycle.
- Test execution: Per the review-run contract, I did not build or run tests; the added tests were reviewed statically.
- User focus: No additional user-provided focus was supplied.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
wyxxxcat
commented
Aug 18, 2026
run buildall |
8ae3c7c to
bbae92aComparewyxxxcat
commented
Aug 18, 2026
run buildall |
hello-stephen
commented
Aug 18, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| << ", code=" << format_as(c0) << ", info=" + m0; | ||
| return false; | ||
| } | ||
| return c0 == TxnErrorCode::TXN_OK; |
There was a problem hiding this comment.
this is a bug... if c0 is not OK, we should not return false
return false IFFc0 == NOT_FOUND
Uh oh!
There was an error while loading. Please reload this page.
3a0b8c1 to
477c111Comparewyxxxcat
commented
Aug 19, 2026
run buildall |
e0ef181 to
2ab5a46Comparewyxxxcat
commented
Aug 19, 2026
run buildall |
hello-stephen
commented
Aug 19, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
2ab5a46 to
844216bComparewyxxxcat
commented
Aug 20, 2026
run buildall |
hello-stephen
commented
Aug 20, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
Uh oh!
There was an error while loading. Please reload this page.
PR approved by anyone and no changes requested. |
PR approved by at least one committer and no changes requested. |
Related PR: #66519 Problem Summary: The recycler previously removed the instance key after the recycle state reached INSTANCE_RECYCLE_STATE_CLEANUP_COMPLETED. This made the final recycle state unavailable and prevented successor-chain checks from distinguishing a completed successor from a missing instance. This change retains the deleted instance record as a tombstone, skips completed tombstones during scanning, excludes deleted instances from ResourceManager runtime indexes and caches, and allows predecessors to continue once their successor has completed cleanup.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #66519
Problem Summary:
The recycler previously removed the instance key after the recycle state reached INSTANCE_RECYCLE_STATE_CLEANUP_COMPLETED. This made the final recycle state unavailable and prevented successor-chain checks from distinguishing a completed successor from a missing instance. This change retains the deleted instance record as a tombstone, skips completed tombstones during scanning, excludes deleted instances from ResourceManager runtime indexes and caches, and allows predecessors to continue once their successor has completed cleanup.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)