Repository navigation
[4.2-dev] Isolate shared metadata cancellation and correct cleanup diagnostics - #32905
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: PR closed or head changed |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: a62d78d9b322d00238104adb67bed8dd1a004880
Assessment: request_changes
The metadata handoff reuses the existing cache coordinator, and terminal diagnostics use the edge’s durable state. The disk-cache change can suppress the warning and error count when cancellation coincides with a failed temporary-file removal.
Model: gpt-6.2-sol / xhigh
Session: 01a1eecd-3287-70c0-bb93-ab923faf5f3f · slot 0 · generation 2
- P2
pkg/fileservice/disk_cache.go:503: The write returns its caller’s cancellation while removing the temporary file fails and cleanup of the final cache path succeeds.
Impact: The temporary path remains on disk, but the write is treated as routine cancellation at DEBUG and the disk-cache error counter stays flat.
Evidence: The defer at line 564 discards the removal error, so the new classifier sees cleanupErr as nil. A race-enabled probe forced the temporary-path removal to fail. The candidate left the path behind and recorded a counter delta of 0. The same probe with the merge-base disk_cache.go emitted a warning and recorded a delta of 1. Carry unexpected temporary-file removal errors into the cleanup diagnostic and cover that path in TestDiskCacheBadWrite.
Validation:
-
Isolation preflight, native build, and git diff --check passed. Receipts 1795023112560506024-5, 1795023168407401776-4, and 1795023399493559253-3.
-
Focused race tests passed for objectio, fileservice, process, compile, connector, and dispatch. Six metadata ownership and reader tests also passed 20 runs each under race. Logs focused-race.log and metadata-stress.log, receipts 1795023324951055135-3 and 1795023371924674713-3.
-
Full readutil and logutil race suites passed. Log reader-event-race.log, receipt 1795023362643657701-3.
-
The temporary-path probe failed on the candidate and passed with the merge-base disk_cache.go overlay. Logs disk-cache-unlink-probe.log and disk-cache-merge-base-probe.log, receipts 1795023326459057934-4 and 1795023373680242092-8.
Limitations:
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: e1ccf5b1e86efd0bd49d3c31b3c05c4f1541c7d6
Assessment: approve
The metadata cache lets a live waiter take over a canceled load while keeping one active loader per key and preserving storage errors. Cleanup logging uses the existing edge state and shared rate limiter. The current head resolves the prior disk-cache finding by logging and counting a failed temporary-file removal even when the caller canceled.
Model: gpt-6.2-sol / xhigh
Session: 01a1ee7f-fdcb-7b83-ad57-3b17a0e9d494 · slot 1 · generation 1
Validation:
-
Frozen source and patch verification, gofmt, isolation preflight, and the native build passed. Receipts 1795025582288183800-2, 1795025914444286620-2, 1795025561993671169-2, and 1795025620773861819-2.
-
Full race runs passed for objectio, process, connector, and dispatch. A reviewer probe verified terminal log levels, rate limiting, and counter increments. Log terminal-metadata-race.log, receipt 1795025926351842868-2.
-
TestDiskCacheBadWrite passed 25 race-enabled repetitions. A separate run confirmed that the warning included the unlink error. Twenty disk-cache tests passed in the final selection, and TestDiskCacheDirSize passed in the broader run. Receipts 1795025790751521926-2, 1795025835776431137-2, 1795026009995789115-2, and 1795025869258657375-2.
-
Reused the prior same-PR race evidence for unchanged behavior, including focused SQL compile tests, full readutil and logutil tests, and 20 repetitions of six metadata handoff tests. Prior receipts 1795023324951055135-3, 1795023362643657701-3, and 1795023371924674713-3.
Limitations:
-
The full fileservice race run timed out during a LocalFS tree write with caching disabled. A separate disk-cache run hit its shorter time limit during fsync in TestDiskCacheDirSize, which had passed in the broader run. Logs fileservice-race.log and disk-cache-race.log, receipts 1795025869258657375-2 and 1795025954065567999-2.
-
The three-CN SIFT1M runs were author-reported. This review did not rerun the historical TKE workload, and the first cancellation in issue #32389 remains unidentified. The frozen evidence references backport PR #29779 without including its contents.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #32389. Backports the metadata cancellation fix from #29779.
What this PR does / why we need it:
When parallel readers share a metadata or Bloom filter load, a normal pipeline stop can cancel the load owner. A waiter whose own context is still live used to receive that owner's cancellation as its read result. This can interrupt or underfill an IVF training sample.
The existing cache coordination now lets a live waiter take over after the owner returns a cancellation attributable to its context. Each caller can issue at most one load under its own context, with at most one active owner per key. Real I/O errors, mixed errors, and the waiter's own cancellation or deadline retain their semantics. Cache hits bypass load coordination.
Scope cancellation that survives classification gets a structured event before cleanup changes context state. It records the phase, original and returned errors, observed context causes, and trace or transaction correlation.
The SQL results, terminal delivery and storage format stay the same. Cache hit behavior is unchanged. The cold metadata path adds one small group allocation and synchronizes admission and cleanup. A single-threaded coordination-only microbenchmark measured 481 to 533 ns/op, excluding object I/O.
Validation
pkg/objectio,pkg/sql/compile, andpkg/vm/engine/readutil. Retained cache ownership cases were also stress-tested under race. Cleanup owners and consumers were covered by the final race run.vector_ip_ops lists=500, returned 10 rows from the normalized vector query each time, and dropped each index. The local launcher used an isolated proxy port. The INFO log contained no reader cancellation errors, false terminal timeout warnings, or disk-cache cancellation warnings during these builds.