Repository navigation
Phase: verify every annexed file reached S3 - #1677
Merged
neuromechanist merged 59 commits intoOct 9, 2026
Merged
neuromechanist merged 59 commits into
neuromechanist merged 59 commits into
Conversation
- git annex copy is driven with --json --json-error-messages; filesCopied counts success records instead of scraping 'copy ... ok' lines (nm000358 logged 'Uploaded 0 data files' while all 165 keys were recorded at nemar-s3 during that copy). - The copy set is taken from the location log (annexed paths not yet at nemar-s3), and the post-copy check now requires EVERY annexed file to be recorded at the remote, not only this run's targets. - A data file larger than the annex size threshold that git-annex did not annex (policy overridden, e.g. an inherited .gitattributes) now fails the upload instead of being committed to git silently. - saveDataset takes skipContentCheckPaths; the upload's save step marks the annexed paths assume-unchanged around git add -A/status/commit so git does not stream every freshly annexed unlocked file through git-annex filter-process (zero-stat index entries after git annex add). Refs #1455. - The success line states sent / already-present / verified totals.
…ad-fixes' into feature/issue-1642-copy-verify
6 of 7 tasks
…ad-fixes' into feature/issue-1642-copy-verify
Contributor
Author
Review findings and resolutionsThe requested Findings
Validation
Residual risk The full local suite, real S3, Ceph measurements, and live-tier checks were not run. A completed-step resume with no pending data still skips opening the remote, as ADR 0092 specifies; changing the external target on that no-op path is outside this fingerprint check. The sandbox entrypoint gap remains documented in |
neuromechanist
merged commit Oct 9, 2026
2cabdbb
into
feature/issue-1671-epic-bru-upload-fixes
14 checks passed
This was referenced Oct 9, 2026
Closed
This branch was previously deployed
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
On nm000358 (165 data files, 1.6 TB) a resumed upload printed "Uploaded 0 data files to S3" although git-annex had recorded all 165 keys at
nemar-s3, and then spent hours in "Saving dataset changes":git annex addstages unlocked files with zero stat data, so the followinggit add -Astreams every annexed file throughgit-annex filter-process(about 1.6 TB re-read) (issue #1642, part of #1455).The S3 step now copies exactly the annexed paths the location log says are not yet at
nemar-s3, requires every annexed file to be recorded there afterwards, and the save step skips the content re-read for large uploads.The first commit is the contributor's original fix (PR #1647, bruAristimunha), preserved with authorship.
The commits on top are review refinements:
git annex copyruns with--json --json-error-messagesand success records are counted; the step logic is extracted intocopyAnnexedToRemote(plan, refuse, copy, verify every annexed file is recorded at the remote) and is driven by tests against real git-annex and a real directory special remote namednemar-s3; wording says "recorded at the remote" because it is the location log, not a bucket HEADassume-unchangedaroundgit add -A,statusandcommit) only applies when the recorded annexed bytes reachSAVE_SKIP_MIN_BYTES(1 GiB, a conservative start and not a measured crossover), so a small tree takes exactly the baseline path with no listing, no stat pass and no index rewrite; the S3 step's annexed set is forwarded to the save instead of being listed againassume-unchangedflags on annexed paths (a killed process between mark and unmark) are cleared at everysaveDatasetentry, including deleted and locked files, leaving a user's own flag on a non-annexed file alone; unmarking is in afinally; a marking failure warns and proceeds without the skipunstageTrackedPaths(moved togit-annex/init.ts) and clears the tracking stamp so a re-run actually re-tracks, names both.gitattributes annex.largefilesand.gitignoreas causes, and prints the exact manual unstage command if unstaging fails; STS credentials are now cleared on every outcome (they leaked on the blocked path)largerthan=100kbas SI (a 100,001 byte file is annexed), while the CLI's constant was 100 x 1024, so files of 100,001 to 102,400 bytes were annexed by git-annex but called small byshouldAnnex; no dataset's tracking changes, only the CLI's classification and the text derived from the constant;isCurrentLargefilesExpressionmakes the fleet scan accept the100kbspelling that about 204 datasets are configured with, which would otherwise have read as drift; boundary tests run both spellings against real git-annexX_MOTION.tsv, whoseexclude=*.tsvmatches whileinclude=*_motion.tsvdoes not) are tracked with--force-largethroughtrackDataFiles; every other data file is added normally, so an inherited.gitattributesoverride still leaves an ordinary data file in git and the not-annexed check stays meaningful; a re-run is idempotentgit annex copyfailures are reported with their reason: when git-annex declines a remote before trying, theerror-messageslist is empty and the reason is only innote, so the old parse printed "file: failed"; messages are de-duplicated; tests use real failing output captured live from a read-only and a missing store rather than hand-written JSONPart of epic #1671. Supersedes #1647 (contributor PR retargeted to the epic branch). Issue: #1642.
For the owner to review
Resume freshness now includes the S3 destination. The fingerprint covers the remote name plus the effective arguments passed to
configureS3Remote(bucket, normalized prefix, region, multipart size, public URL, protocol and fixed options); credentials are excluded. A real git-annex directory-remote test reconfigures the same remote name to a second store and proves the new destination is populated. Removing target identity from the fingerprint made that regression fail; restoring it made the test pass. A no-pending resume still skips opening the remote under ADR 0092, so an externally changed destination on that no-op path remains outside this check.Remaining test boundary. The sandbox tests exercise
saveAndPushwith a real repository and bare origin. FullsandboxCommandorchestration reaches the shared backend, GitHub org and S3; its entrypoint coverage gap and required isolated staging conditions are recorded intest_requirements.md.ADR 0031 amendment (binding text, three sections): the threshold is 100,000 bytes; the CLI's selection is authoritative for case variants of data globs; and a known gap, below.
Known gap, measured and not fixed here:
git annex initwrites* filter=annexto.git/info/attributes, so the save'sgit add -Adoes annex byannex.largefiles(ADR 0031's earlier claim that it does not is false). An uppercase METADATA file over the threshold (for example a 200 KBBIG.JSON) is annexed at save time, after the S3 step, so its content never reaches S3 and the commit carries an unresolvable pointer. It needs an uppercase metadata extension that BIDS validation should reject. A post-savegit annex find --not --in nemar-s3would catch it (0.2 s at 600 annexed files, 3.7 s at 10,000), but a re-run does not copy a file no add target names, so the check could not be cleared by re-running. To be filed as a follow-up.Ceph numbers cannot be reproduced here. Please re-measure on the nm000359 host; 1 GiB is a conservative gate (the Ceph tree is 72 MB of annexed data, nm000358 is 1.6 TB).
The
docs.nemar.orgvalidated-workflows page still sayslargerthan=100kb; both spellings are correct and it can move to the byte count when next edited.Behavior to know about
git statusafter a skipped save re-hashes everything (339 ms at 600 files, 4.5 s at 15,000, against 12 ms and 45 ms after a plain save). At 1.6 TB the nextgit statusornemar dataset updatepays for it once..edfplus 600 JSON tree saves in about 1.0 to 1.1 s below the gate and 0.8 s with the gate open, against 1.2 s at baseline; a 15,000-file tree takes 10 to 12 s below the gate and 5.6 to 6.2 s with it open, against 9.7 s at baseline.X.EDFwere never committed to git: the production expression ORs the size clause, so they annex by size. An earlier hypothesis that they would be refused by the new blocking check was wrong; only the uppercase_MOTION.tsvcase needed the force step.Test plan
bun test test/copy-json-real.unit.test.ts test/run-command-redaction.unit.test.ts test/upload-data-steps.unit.test.ts test/upload-recorded-check.unit.test.ts test/upload-s3-copy-step.unit.test.ts test/upload-save-failures.unit.test.ts test/upload-transfer-recovery.unit.test.ts— 133 pass, 0 fail across seven files, using real Git, git-annex and directory remotes.bun run typecheck(root and backend),bun run lint, Biome check on 12 changed TypeScript files, andgit diff --check.testRequest|TEST_API_URL|runCli\() finds no matches in these seven test files.test_requirements.md.Follow-ups (not in this PR)
nemar dataset push/updateand the sandbox (copyToAnnexRemote) keep the weaker flow