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. |
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 <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
08c0893 to
904ff85
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.
Verified on v2.0.0 (
73b9a3a): lint clean; uncachedmake test1,900 tests/15 credential-gated skips in 54.055s versus 58.821s before trimming (4.766s saved); pure-Go build, root/rows race tests, and full kernel-tagged build/tests on default Go 1.27.4 with bindings v1.5.0. Renewal/millisecond regressions fail on main; the new closed-operation 503 test fails before the correction and passes on main. Three live Thrift tests pass without skips (47.858s): 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. Live timings use a shared warehouse. The three generated-file formatting exceptions also occur on main. Shared CLOUDFETCH-001 still XFAILs on its injected HTTP 401, not timestamp expiry; it is not counted as passing coverage.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 fresh 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. Sibling #565/#587 changes are not included.
Addresses #475 (part 3)
This pull request and its description were written by Isaac.