Repository navigation
Spread new objects over a set of buckets - #225
Merged
Merged
Conversation
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
Some storage systems reach full speed only when several buckets are active at once.
spt run --bucket-count N(enginestorage.targetBucket.count, 1 to 1000, default 1) spreads the objects a run creates overNbuckets named<bucket>-0to<bucket>-<N-1>.floorMod(floorDiv(id, max(P, 1)), N), from its object id and the prefix-shard countP. Placement happens at the path layer, like--prefix-shards, so every bucket still gets every shard directory. With the default random naming every worker writes to every bucket at once. The spread is statistical, not equal at every instant.--read-items-filehas no seed phase, so it creates the members in its own setup.ps-3is the same bucket at any count. Every generated name is checked against the AWS bucket naming rules before anything is sent.s3,s3-awsands3-rdma. Eachs3ands3-rdmaworker checks each member once, with a HEAD on its first operation to that bucket.With one bucket nothing changes: the same paths, requests and artifacts.
Changes
TargetBucketSet(count, member paths, name rules, validation) andTargetBucketStep(what setup needs to know about mixed and pipeline steps);TargetBucketsandTargetBucketProvisioningprovision a step's members; the new hookLoadStepClientBase.targetBucketStep()is overridden by the mixed and pipeline clients;OperationsBuilderImplandDataOperationsBuilderImplchoose each new item's member path throughnextOutputPath(item);LoadGeneratorBuilder.targetBucketCount()wires the count into the linear, pipeline, weighted and mixed steps;IntegrityOperationManifestOutputrecords each result's own bucket;storage.targetBucket.count: 1;storage.auth.file;item.output.path.--bucket-countwrites the count into the generateddefaults.yamland restores it after engine overrides; an--engine-overridethat sets the count is rejected;deletewith a count above 1 requires--delete-batch-size=1;read --items-file,delete --items-file,delete --delete-existing,read-verify,list,tablesandmockreject a count above 1;Bucket Count: N (<first> ... <last>);spt replaykeeps an archived run's count;cli/tools/testmultibucket.sh [BUCKETS](default 16) runs a short demo over a set.cli/docs/TARGET_BUCKETS.md,SPT_SYNTAX.mdand the s3 driver README, and the CHANGELOG under Unreleased › Added.Compatibility
LoadGeneratorBuilder.targetBucketCount()and new protected hookLoadStepClientBase.targetBucketStep(). Existing constructors are kept.Performance: hot path, Class B
Placement adds a little work per operation in the operation builders:
N > 1, oneoffset()call, onefloorModand an array load, plus afloorDivwith prefix shards.There is no allocation, lock, atomic or hand-off. The tolerance was declared before measuring:
N = 1within ±3% ofmain, andN = 16at most 10 ns per operation overN = 1.TargetBucketBuilderBench:main11f7edc9, pinned to two cores;Other benchmarks:
ManifestWriterBench: with one bucket, 330 ns per result on the branch against 344 ns onmain, with identical allocation (496.1 B per result).FirstUseColdStartBench: with 1000 members, the first-use HEADs overlap operations already in flight. At 1 ms per HEAD, three times the lab median, they add no measurable time. At 5 ms they add 0.85 s, against a 10 s budget.Notes
spt run delete --label <name>exits 1 at the summary;--delete-items-fileappears to load the whole file on every worker.