Repository navigation
Add native CDC operator status and guarded removal - #13926
tclinkenbeard-oai merged 5 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tclinkenbeard-oai
left a comment
There was a problem hiding this comment.
Generated by Codex.
What is it trying to do?
Add native CDC operator tooling: cdc status [json] for durable retention metadata and advisory proxy samples, plus identity-guarded removal requiring explicit data-loss confirmation. It also adds audit traces, operating guidance, and lifecycle coverage without changing retention policy or persisted formats.
Is it correct?
The implementation looks correct by source inspection:
- Removal safety: the expected stream ID remains fixed across retries. The existing removal transaction rechecks the name-to-ID mapping and atomically records retired-tag cleanup, preserving same-name replacements and shared-tag retention.
- Status consistency: all seven durable metadata ranges share one transaction read version. Returned names, ranges, and paginated results own their storage. Incomplete metadata cannot produce a positive drained result.
- RPC safety: the status endpoint is private, preserves existing interface serialization and endpoint offsets, and performs at most 256 stream lookups per request. Sampling failures remain explicit without discarding durable metadata; cancellation propagates.
- Coverage: the added lifecycle assertions check actual removal outcomes, replacement preservation, shared-tag blockers, pending/completed cleanup, disabled admission, and request-size rejection.
The new RPC records are transient; existing durable encodings are unchanged.
No builds, tests, or simulations were run for this review. Current-head public CI shows four passing checks and six pending, with no failures. Pending checks are not validation passes. PR checks
Are there bugs?
I did not find any correctness bugs.
The review included compatibility boundaries, hot-path cost, async ownership and cancellation, preservation of existing invariants, and whether the added tests can detect their intended failures.
Are there omissions?
Two nonblocking coverage gaps would be useful follow-ups:
- Degraded status: exercise unavailable proxy samples and incomplete metadata, checking that durable output survives, errors remain explicit, and JSON
metadata_drainedbecomesnull. - Client batching: exercise more than 256 legitimate stream IDs and verify complete aggregation. The oversized-request test checks server rejection, not successful client-side splitting.
The documentation appropriately leaves sustained-load, recovery, and mixed-version qualification as separate production work.
Are there better ways of doing things?
Reusing the existing identity-specific removal and retention machinery keeps the destructive path narrow. The separation between transactional metadata and advisory samples is appropriate. I would extend the existing tests for the gaps above; no broader redesign appears necessary.
Should this CL be LGTMd?
Yes, LGTM for the stated operator-safety scope. The inspected removal and retention invariants are preserved. The main remaining risk is degraded or large-cardinality status behavior, where direct coverage is thinner. This is not a production-readiness or mixed-version qualification sign-off.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| const size_t end = std::min(streamIds.size(), begin + GetCDCProxyStatusRequest::MAX_STREAMS); | ||
| GetCDCProxyStatusRequest request; | ||
| request.streamIds.assign(streamIds.begin() + begin, streamIds.begin() + end); | ||
| samples.push_back(timeoutError(throwErrorOr(proxy.getStatus.tryGetReply(request)), 2.0)); |
There was a problem hiding this comment.
Should this 2.0 be a knob? In simulation with clogging and buggify, do you expect any noise?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
Result of foundationdb-pr-macos-m1 on macOS 14.x
|
Result of foundationdb-pr-macos on macOS 14.x
macOS stat flags, not linux compatiblelock_mtime() { stat -f %m $LOCK || echo 0 }
|
Summary
fdbcli cdc status [json]to join durable stream identities, ranges,acknowledgement watermarks, owners, shared-tag blockers, and retired cleanup.
Bounded, trusted proxy samples expose buffer pressure and recovery state;
unavailable samples remain explicit rather than appearing as zero usage.
cdc remove <NAME> <EXPECTED_STREAM_ID> CONFIRM-DATA-LOSS. The expectedidentity remains fixed across retries, preserving a same-name replacement and
the existing shared-tag and retired-pop guarantees.
stalled consumers, explicit history loss, consistent downstream rebuilds,
admission-off drain, and the prerequisites for binary rollback.
versus completed cleanup, disabled admission, shared-tag blockers, and status
RPC bounds. Add CLI status and destructive-argument coverage.
Safety and scope
This does not introduce automatic expiration or change acknowledgement, log
retention, or persisted metadata formats. The proxy status endpoint is additive;
existing serialized interface fields and endpoint offsets remain unchanged.
Status does not treat proxy memory as retained TLog disk, an allowed pop frontier
as physical reclamation, or an old generation as proof that CDC caused a recovery
delay. CLI audit logging must be enabled explicitly with
--log.Validation
fdbclient_test -f /NativeCDC/: 4 passed, 0 failed.fdbserver_cdcproxy_test -f /NativeCDC/: 11 passed, 0 failed.NativeCdcEndToEnd,NativeCdcAssignmentPublication,NativeCdcRetiredSharedTagSnapshot,NativeCdcRetiredRecovery,NativeCdcRetiredRecoveryMultiRegion, and thetwo-phase
NativeCdcDisableRestart-1/NativeCdcDisableRestart-2test.single_process_fdbcli_testssuite passed, including the new CDCstatus and removal-argument checks.
clang-format19.1.7 checks;git diff --checkpasses.a Black formatting hunk in
client_threads_per_version_env_ignoredand E741in the existing clear-range comprehension. Those lines are left unchanged.
Remaining production qualification
This is an operator-safety milestone, not a production-readiness declaration.
Deployment-specific alert thresholds, sustained-load and recovery drills,
physical retention attribution, and mixed-version upgrade/rollback qualification
remain separate work.