Repository navigation
runner: choose the pack generation from a registry and check the dataset with the built binary - #44
Merged
Merged
Conversation
…set with the built binary - internal/packgen/generations.json lists the pack generations newest first (packs-v6, packs-v5, packs-v4). Each entry has a git grep source marker, an optional absent marker, the writer commit and a format note. run.DetectPackGeneration picks the first entry that matches the built commit. plan.json records pack_generation (now the full name, such as "packs-v5") and pack_marker. - A packs-s3 location segment that names any registered generation is rewritten to the chosen one. - Before the build, campaign run lists each packs-s3 location it will fetch and fails on an empty one, naming the generation the registry chose. - After each pack dataset is ready, the runner runs the built binary on one ledger (bench ingest hot --num-ledgers=1) in a scratch dir, and stops the campaign with the binary's error when it cannot read the dataset. This replaces the trailer-bytes check, which cannot tell packs-v5 from packs-v6. Claude-Session: https://claude.ai/code/session_01S2XwYtZzcJnyxHU9TC3oLh
Contributor
|
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
runner/internal/packgen/generations.json. It lists the dataset pack generations, newest first:packs-v6,packs-v5,packs-v4. Each entry has areader_marker(agit grep -Epattern and paths,_test.goexcluded), an optionalreader_absent, awriter_commitand a one-lineformat_change. The runner embeds the file, and the tests parse it.run.DetectPackGenerationpicks the first entry whose markers match the built commit. If no entry matches, the generation is unknown: the runner does not rewrite the location, and the read check still runs.packs-v6:groupHasCounts uint8 =(stellar-rpc a130b9e2cmd/stellar-rpc/internal/rpcv2/packfile/index.go:29, added by c8d48764).packs-v5:trailerSize = 44(4d30c258packfile/packfile.go:14), anddirEntryLen =must not match (a130b9e2index.go:40, added by 4ca7bd1c). This keeps a commit with the new index directory but without per-group counts from being taken as v5.packs-v4:trailerSize = 76(1c0572dapackfile/packfile.go:15).plan.jsonrecordspack_generationas the full name (for example"packs-v5", was"v5") and the newpack_marker. The dry-run note gives both.packs-s3location, each path segment that names a registered generation changes to the chosen generation.configured_locationstays as in runner: choose the dataset pack generation the ref reads, and refuse a mismatch before ingest #43.campaign runlists eachpacks-s3location that it will fetch. If a location is empty, the campaign stops. The message gives the missing prefix and the generation that the registry chose.--no-preflightskips this check.packs-local,packs-gsorpacks-s3dataset is ready and before any leg, the runner runs the built binary on one ledger. The command is<bin> --enable-rpcv2 bench ingest hot --source=pack --pack-dir=<root>/ledgers --start-chunk=<first chunk> --num-ledgers=1 --close-interval=0 --hot-dir=<scratch>/hot --out=<scratch>/out. It runs in$BENCH_ROOT/scratch/readcheck-<name>, which the runner removes before and after the check, and it gets the sameGOMEMLIMITas the legs. If the check fails, the campaign stops, also without--fail-fast. The error gives the binary's own last lines and the textdataset <name> is <generation>; the registry chose it for <sha8> by marker <…>. Only plans withstatic_libs(--enable-rpcv2) have this check. Older refs check nothing.packcheck.goand its fixture packs).runner/README.mddocuments the registry and how to add a generation.Why
stellar-rpc a130b9e2 (4d30c258 + packfile 4ca7bd1c, 5546d795, c8d48764) changes the layout of the ledger pack index, but the trailer stays 44 bytes. It rejects packs-v5 at open with
packfile: corrupt file: index group 0 starts at item …. The trailer check of #43 cannot tell packs-v5 from packs-v6. With this change, a new generation needs only a freeze, an upload and a registry entry, and no code change. The read check uses the same reader as the legs, so it finds any format mismatch, not only a trailer mismatch.Campaigns read only
<root>/ledgersfrom a golden dataset. The query legs read the stores that the campaign's own ingest builds. Thus the markers identify the ledger pack reader only.packs-v6is in the registry now, but it is not uploaded yet. It becomes usable when the packs-v6 freeze is uploaded for the three phase-3b C1 profiles (sac-9000, custom_token-5400, soroswap-2700). Until then, a campaign at a ref that reads packs-v6 stops at the availability check, before the build.Testing
cd runner && go vet ./... && go test -count=1 ./...: all 11 packages pass, 409 tests and subtests. New and changed tests:gitrepos with commits shaped like v4, v5, the 4ca7bd1c-only directory (selects none), v6, and markers in test files only. Also a new top entry (packs-v7) that the runner selects with no code change.GOMEMLIMITreaches it, the scratch dir is removed) and one that fails (the walk stops, and the error has the binary's error and the registry's choice).packs-gsdataset.make test(converter): 161 tests, OK (13 skipped).make smoke: 4758 passed, 0 failed (35 runs).campaign planwith the phase-3b config, againstgit clone --sharedcheckouts of stellar-rpc:pack generation: packs-v4, the runner fetches…/packs-v4/cold.packs-v5, the runner fetches…/packs-v5/cold.packs-v6, the runner fetches…/packs-v6/cold.packfile: corrupt file: invalid magic number.packfile: corrupt file: index group 0 starts at item 3426353155.Not covered
campaign runon a box. I did not run the availability check against the real bucket, because there are no AWS credentials on the local machine.campaign planof a ref that the clone cannot resolve now assumes the newest registry entry (packs-v6), notpacks-v5.https://claude.ai/code/session_01S2XwYtZzcJnyxHU9TC3oLh