Repository navigation
Publish S3 dataset cache files atomically - #745
Merged
Merged
Conversation
Contributor
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
tlwillke
marked this pull request as ready for review
October 11, 2026 03:40
tlwillke
requested review from
MarkWolters,
ashkrisk and
jshook
as code owners
October 11, 2026 03:40
MarkWolters
approved these changes
Oct 11, 2026
MarkWolters
left a comment
Contributor
There was a problem hiding this comment.
I think this looks fine. I'll mention that compaction also has its own s3 download path in CompactionPartitionSource that this does not touch and it would be good in the future to deduplicate that cc: @dian-lun-lin
ashkrisk
approved these changes
Oct 12, 2026
ashkrisk
left a comment
Contributor
There was a problem hiding this comment.
PR looks good. There were no issues having two runs of BenchYAML running simultaneously and trying to download the same dataset. This would occupy extra disk space for as long as the BenchYAML processes are running, but that doesn't seem like a big concern given our typical usage patterns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix a shared-cache race in the benchmark dataset loader's S3 download path.
Currently, S3 downloads write directly to the final cache filename.
ensureFileAvailableaccepts an existing path as a cache hit, so another process can use a partially downloaded file. A killed process can leave that partial file at the cache name. Failed attempts also delete the shared destination, potentially removing another process's completed download.Each S3 attempt now downloads to a unique temporary file in the destination directory. After completion and the existing content-length check, it atomically renames that file to the cache path. Failures delete only their own temporary file. HTTP already uses atomic publication and is unchanged.
This is based on current main
056d93c2. It changes the examples dataset loader only.Validation
mvn -Pjdk20 -pl jvector-examples -am \ -Dtest=DataSetLoaderSimpleMFDTest,TestDatasetDownloadPublication \ -Dsurefire.failIfNoSpecifiedTests=false testLimits
Concurrent callers may still download the same object independently; publication is atomic rather than serialized by a new locking mechanism. Hard termination may leave an ignored temporary file. Existing cached files are not retroactively validated, so previously interrupted downloads should be removed before reuse.
A bug-fix release note is included.