Repository navigation
Conversation
geruh
left a comment
There was a problem hiding this comment.
Thanks for raising @dsingh-exa! I think keeping the files here makes sense since a failed reservation doesn't necessarily mean they're unreferenced, especially with retries. Just left a couple minor nits.
| let ds = Dataset::open(test_uri).await.unwrap(); | ||
| assert_eq!(ds.count_rows(None).await.unwrap(), num_rows); | ||
| assert_eq!(ds.version().version, published_version); | ||
| assert_eq!(ds.scan().try_into_batch().await.unwrap(), expected); |
There was a problem hiding this comment.
nit: could we also run cleanup_old_versions after the failed replay and check that the data is still readable? I think it'd be good to make sure GC doesn't delete the files from the earlier commit.
| // path below can clean them up (or deliberately keep them). Fragment ids | ||
| // may still be reassigned by reserve_fragment_ids; cleanup only needs the | ||
| // file paths, which never change. | ||
| let all_new_fragments: Vec<Fragment> = completed_tasks |
There was a problem hiding this comment.
nit: looks like all_new_fragments is only used for .len() now that the cleanup is gone. could we just count the fragments instead of cloning them?
`RewriteResult` is serializable, so a compaction result can be committed again after an earlier commit already published it. If reserving fragment ids for that replay fails, `commit_compaction` deleted the rewritten files. Reassigning fragment ids does not change data file paths, so those files can still be referenced by the published version, and deleting them leaves the dataset unreadable. Leave the files in place when reservation fails, matching the existing handling of a failed rewrite commit. Unreferenced output is reclaimed by `cleanup_old_versions`. Cleanup after a failed rewrite is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… of cloning Co-Authored-By: Claude Opus 5.5 <[email protected]>
52322c3 to
8bcfe25
Compare
geruh
left a comment
There was a problem hiding this comment.
LGTM, thanks for addressing comments @dsingh-exa!
pending maintainer review
There was a problem hiding this comment.
✅ Gate recommendation: approve.
A failed reservation cannot establish that replayed files are unreferenced, so retaining them for dataset GC remains appropriate. The regression cases verify that GC preserves published data after a failed replay in both reservation paths, while fresh orphaned output remains reclaimable.
Xuanwo
left a comment
There was a problem hiding this comment.
Reviewed: on fragment-id reservation failure, rewritten files are no longer deleted immediately - a replayed RewriteResult can already be published, and reassigning ids does not change file paths, so deleting them would break the published version. Both reservation paths now leave files to cleanup_old_versions/GC, consistent with the existing failed-commit handling. Tests cover first-commit failure (files reclaimed by GC, readability preserved) and replay failure (published version/files survive GC). CI green; approving.
RewriteResultis serializable, so a compaction result can be committed again after an earlier commit already published it. If reserving fragment ids for that replay fails,commit_compactiondeleted the rewritten files. Reassigning fragment ids doesn't change data file paths, so those files can still be referenced by the published version. Deleting them makes the dataset unreadable: on the base, replaying a published compaction with an injected reservation failure leaves the current version failing to scan withNot found.This keeps the files when reservation fails, which matches how a failed rewrite commit is already handled. Cleanup after a failed rewrite is unchanged.
Tradeoff: output that really is orphaned now waits for
cleanup_old_versions. Withdelete_unverifiedit is reclaimed immediately; otherwise it waits for the 7-day unverified threshold.This partly reverts the reservation-failure cleanup from #7722. That PR reasoned that reservation commits don't reference the rewritten files, which doesn't hold for replays.
Tests cover both the address-style path (
defer_index_remap) and the stable-row-id path: