Repository navigation
feat: re-fetch expired Thrift CloudFetch links - #586
vuanhphung wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
✅ No issues identified.
🔀 1 finding considered and dismissed by the judge
- 🟡 Medium
internal/rows/arrowbased/batchloader.go:652— When renewal is unavailable (renewalBuffer==0, e.g. direct results with CloseOperation), a locally-expired link now gets a GET, and the storage 403 falls throug
Judge's evidence:if res.StatusCode == http.StatusForbidden && renewalBuffer > 0 && isLinkExpired(link.ExpiryTime, renewalBuffer) {
e02272c to
8c6a337
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Low
Looks good, no blocking concerns. I traced renewal locking, how the operation lifecycle closes, cancellation, and redaction across the rows, batches and IPC paths. Nit: after Close, cloudIPCStreamIterator.Next now returns context.Canceled instead of io.EOF. Every caller I checked stops before calling it.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
| return task, nil, 0, refetchErr | ||
| } | ||
| renewalFailure = refetchErr | ||
| if lastDownloadErr == nil && lastStatus == 0 { |
There was a problem hiding this comment.
🔵 Low — When a retryable GET failure is followed by backoff into the expiry buffer and the renewal RPC then fails, recoverExpiredDownload returns the error. The saved download cause or status blocks the fallback to the original URL, even though retries remain and storage may still accept the URL under clock skew. Track whether the download was interrupted rather than exhausted, and resume the original URL within its remaining retry budget. This is a narrow edge case.
🔀 Found by GPT-6.1 Sol · confirmed by the judge
There was a problem hiding this comment.
Leaving this as follow-up under the approved D27 scope. A real GET failure has already occurred and the renewal RPC also failed; this is not a failure based only on the local clock. The same stop condition exists at 8c6a337 (lastDownloadErr == nil gates fallback in recoverExpiredDownload). Preserving a partially consumed GET retry budget would add recovery state/semantics beyond this scope correction. The last download cause/status and renewal RPC error remain visible.
This comment was generated with GitHub MCP.
There was a problem hiding this comment.
Still open at 08c0893: batchloader.go:300 still skips the original-URL fallback after a GET failure even when retries remain; deferring it is fine.
|
Checked the overview nit about Next after Close: this is the internal CloudFetch iterator reporting the cancellation needed to stop in-flight work; the public rows/batch/IPC consumers stop before calling it after Close. Leaving that internal behavior unchanged rather than widening this scope round. This comment was generated with GitHub MCP. |
|
The kernel CI job exited with native This comment was generated with GitHub MCP. |
08c0893 to
904ff85
Compare
904ff85 to
a439e82
Compare
Honor millisecond expiry and renew pending page links on the consumer path with a 30-second buffer, bounded retries, and preserved error causes. Let storage decide validity under clock skew. Keep final CloudFetch operations open until consumption or Close so long reads can renew links. No public API or option changes. Addresses #475 (part 3) Signed-off-by: Vu Anh Phung <[email protected]> Co-authored-by: Isaac <[email protected]>
a439e82 to
8c3dd13
Compare
Expired Thrift CloudFetch links fail large or slow reads; the existing seconds-based expiry check also misses the server's epoch-millisecond timestamps. Re-fetch links on the consumer path under the operation lock, using the original operation and absolute row offsets. Renew the remaining page with bounded partial-response follow-ups, preserve completed downloads, and restart renewed downloads in parallel across rows, Arrow batches and IPC.
Use milliseconds and a 30-second buffer only when renewal is possible, honoring larger internal buffers. Near-expiry HTTP 400/403s can renew, following the kernel's stale-link recovery; unexpired failures keep normal download handling. Local expiry alone never fails a read: storage still decides validity under clock skew. Final CloudFetch operations now remain open until consumption/Close; cancellation stops renewal and terminal errors preserve download causes plus bounded, redacted renewal errors. Operations that cannot renew retain the existing download error. No new public option or required interface member. Renewal preserves the caller's deadline cause; the rebase also converts #587-added expiry fixtures to the IDL's epoch milliseconds.
Verified after rebasing onto
319b145(#587, #565, #595): lint clean;make test2,075 tests/16 credential-gated skips in 137.062s including initial build; pure-Go build/vet, shuffled root/rows race tests, and full kernel-tagged build/tests on Go 1.27.4 with bindings v1.5.0. All three live renewal tests plus #565's nine-case Thrift schema matrix pass without skips (78.166s): each API preserves 2M ordered IDs/checksum 1,999,999,000,000 with zero versus one renewal; three-page IPC preserves 8.5M/checksum 36,124,995,750,000 and cursor restoration. Five live kernel checks pass without skips (6.095s). A test-only overlay verifies no-direct-results lazy schemas with forced renewal: batches/IPC × server/inferred schema, 50 race repetitions each; authoritative #351 overrides remain and inferred schemas use the file schema. Live timings use a shared warehouse. The three generated-file formatting exceptions match freshly exported main. Prior caller-deadline and cancellation-order tests each passed 1,000 race repetitions; all three deterministic cases fail on unfixedd2caf39. Shared CLOUDFETCH-001 still XFAILs on injected HTTP 401, not timestamp expiry; it is not counted as passing coverage.CI on
8c3dd13: bot approved with no new findings; both Go versions, lint, security and DCO pass. Source-built kernel CI failed three attempts with unsupported-inline/TLS-closeSIGPIPE. Interaction with #565/#595 is under investigation: the earlier main reproduction used the published archive and does not establish comparable source-built failure rates. A native pilot locates a TLS-shutdown write after the test server closes its peer; the five-revision source-build comparison needs the pinned Rust toolchain. No kernel source or test fix has been committed.Fresh
319b145versus rebased-head 5MiB download benchmarks use identical overlays, three alternating fresh processes/version and six 200ms samples/process (n=18): default-client medians 2.147→2.055ms (-4.27%, p=.007),WithTransport2.029→2.080ms (+2.50%, p=.005), with roughly five extra allocations/file. This measures ordinary downloads, not renewal RPC latency; the cause fix only runs during renewal.Prior v2.0.0 benchstat uses identical overlays, three alternating fresh processes/version and six 500ms samples/process (n=18/case/version). The disclosed v2 rebase sweep below reaches +7.07% loopback overhead (small IPC, p<.001); large batches measure +5.36%. A later pre-rebase sweep measures loopback rows 254.0→264.0 µs (+3.93%, p<.001), with other loopback differences not significant (p≥.051). Memory overhead is +2.72/+2.79/+4.79% for small rows/batches/IPC; large rows +2.66%, batches -2.14%, IPC -3.16%. These microbenchmarks do not establish zero overhead; tiny results retain roughly 0.8–1.2 KiB and 10–12 extra allocations. Percentages in the retained table denote p<.05; other differences are not significant.
Cross-driver state
ChunkLinkDownloadService.java:363@0ad7a49; strict milliseconds,DatabricksHttpException.Error;downloader.py:57,181@087b2bf. SEA uses kernel.MinTimeToExpiry=0); existingDriverError/expiry matching retained. SEA unchanged.Error;CloudFetchResultHandler.ts:125@abedbbf. SEA uses kernel.kernel_error::Error;link_fetcher.rs:120,types/cloudfetch.rs:30@fe52b66.Follow JDBC's Thrift offset/range contract and the kernel's 30s buffer. Storage fallback avoids clock-skew-only failures. #587, #565 and #595 are in the rebased base; range-diff preserves the single reviewed commit apart from changelog placement and the nightly-test union. Adversarial review previously converged; this rebase requires no new round.
Addresses #475 (part 3)
This pull request and its description were written by Isaac.