feat(cli): make migrate in-flight budget configurable, raise default to 50 GB - #233
Merged
Merged
Conversation
…light-gb `tigris buckets migrate` capped in-flight migrations — objects scheduled server-side but not yet confirmed — at a fixed 10 GB. Any single object larger than that could only run once the queue had drained, so a bucket of multi-gigabyte files migrated close to serially. - Raise the default budget to 50 GB, letting several large objects transfer concurrently. - Add `--max-in-flight-gb` to override it per run, accepting 1 to 100. Out-of-range and non-numeric values are rejected before discovery lists the bucket rather than clamped, so the flag always means what it says. The option registers as `[value]`, so a bare `--max-in-flight-gb` arrives as boolean `true` — that is an error, not `Number(true)` = 1 GB. - Move the budget from a module constant onto `MigrationState`, since it is now per-run configuration that both capacity checks read; `atCapacity` and `shouldFlushBatch` keep their signatures. - Guard the spec default against the in-code default in tests. The spec's `default: '50'` is what commander supplies at runtime, so drift would make the constant dead code and quietly change the budget. `MAX_IN_FLIGHT_OBJECTS` (1,000) and `SCHEDULE_BATCH_SIZE` are unchanged. The two caps cross over at `budget / 1000`, so the raise only loosens runs averaging more than 50 MB per object; below that the object cap still binds. Assisted-by: Claude Opus 5 via Claude Code Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Greptile SummaryThe PR raises the default migration in-flight byte budget from 10 GB to 50 GB and adds a validated per-run override.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security failures identified. The new option is correctly wired through Commander, validated before network access, initialized on the only production migration state, and consistently enforced by both batching and in-flight capacity checks. Important Files Changed
Reviews (1): Last reviewed commit: "feat(cli): raise migrate in-flight budge..." | Re-trigger Greptile |
The @biomejs/biome devDep floats on ^2.4.13, so a lockfile refresh moved the binary to 2.5.6 while $schema stayed pinned at 2.5.4, making every `biome check` print a migration notice. Applied with `biome migrate --write`; the schema URL was the only change. Assisted-by: Claude Opus 5 via Claude Code Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
packages/cli/README.md is generated from specs.yaml by `pnpm updatedocs` and had not been regenerated since several commands landed. Documents `tigris init`, `buckets rebase`, `buckets merge`, `--default-tier`, stdin input for `objects put`, and `--snapshot-version` on `objects restore` and `restore-info`. No behavior change. The `buckets migrate` section is unchanged, which confirms the hand-applied docs in 7a36d89 matched the generator exactly. Assisted-by: Claude Opus 5 via Claude Code Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
MantasMiksys
approved these changes
Aug 4, 2026
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.
What
tigris buckets migratecapped in-flight migrations — objects scheduled server-side but not yet confirmed — at a fixed 10 GB. Any single object larger than that could only run once the queue had drained, so a bucket of multi-gigabyte files migrated close to serially.--max-in-flight-gboverrides it per run, accepting 1–100 (default 50). Out-of-range and non-numeric values are rejected before discovery lists the bucket rather than silently clamped, so the flag always means what it says. The option registers as[value], so a bare--max-in-flight-gbarrives as booleantrue— that is an error, notNumber(true)= 1 GB.MigrationState.maxInFlightBytes, since it is now per-run configuration that both capacity checks read.atCapacityandshouldFlushBatchkeep their signatures.MAX_IN_FLIGHT_OBJECTS(1,000) andSCHEDULE_BATCH_SIZE(50) are unchanged.Commits
7a36d89feat(cli)— the change described above.ef4690fchore(repo)—biome.json$schema2.5.4 → 2.5.6 viabiome migrate --write. The@biomejs/biomedevDep floats on^2.4.13, so the binary had moved ahead of the pin and everybiome checkprinted a migration notice. The schema URL was the only change; no deprecated config to migrate.ffb8b14docs(cli)— regeneratedpackages/cli/README.md. It is generated fromspecs.yamlbypnpm updatedocsand had gone stale, so this also picks uptigris init,buckets rebase,buckets merge,--default-tier, stdin input forobjects put, and--snapshot-versiononobjects restore/restore-info. Thebuckets migratesection came out byte-identical to the version hand-written in7a36d89, confirming those docs were already correct.Notes for reviewers
This raise only helps large-object runs. The byte cap and the object cap cross over at
budget / 1000, so the crossover moved from 10 MB to 50 MB average object size. Below that,MAX_IN_FLIGHT_OBJECTS = 1000is still the binding constraint and this change has no effect there. If we later want to lift the object cap too,CONCURRENCYshould move with it —drainCompletedpolls in windows ofCONCURRENCY, so a larger in-flight set stretches a full sweep proportionally.Spec/code default drift guard. The spec's
default: '50'is what commander actually supplies at runtime, so if it drifted fromDEFAULT_MAX_IN_FLIGHT_GBthe constant would become dead code and the CLI would quietly run the spec's number instead. A test asserts the two resolve to the same budget.Test plan
tsc --noEmitcleantest/lib/buckets/migrate.test.tspass — 12 new (parse bounds, fractional values, bare flag, budget overrides changing capacity decisions, spec-default drift guard). Two existing byte-budget cases were retargeted, since 22.8 GB no longer exceeds the budget: the original bug-report scenario is kept against an explicit 10 GB budget, with a new counterpart proving the same pair now batches freely at 50 GB.--helprenders the flag;500,0.5,abcand a bare--max-in-flight-gbeach fail with the right message and exit 1, before any network or auth callRelease
Changeset included —
minorfor@tigrisdata/cliandtigris(kept in lockstep by the Changesetsfixedgroup). The regenerated README ships with that release; the biome bump is repo tooling and never reaches npm.🤖 Generated with Claude Code