Repository navigation
Upload: verify every annexed file reached S3 and stop re-reading annexed content on save - #1647
Closed
bruAristimunha wants to merge 1 commit 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 nemarOrg#1455. - The success line states sent / already-present / verified totals.
This was referenced Oct 7, 2026
This was referenced Oct 7, 2026
Merged
neuromechanist
changed the base branch from
dev
to
feature/issue-1671-epic-bru-upload-fixes
October 7, 2026 22:06
This was referenced Oct 8, 2026
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.
Problem
#1642: on nm000358 (165 data files, 1.6 TB, 0.10.13) a resumed upload printed "Uploaded 0 data files to S3" although git-annex recorded all 165 keys at
nemar-s3during that copy, and then spent hours in "Saving dataset changes".copyToAnnexRemotecountedcopy … oklines in git-annex's human-readable output.addTargetsthat happened to be annexed, so a data file git-annex did not annex, or an annexed file left from an earlier run, passed without being checked.git annex addstages unlocked files with zero stat data (git ls-files --debugshowsctime: 0:0), so the followinggit add -Astreams every annexed file throughgit-annex filter-process. That is the save-step stall in the 2026-09-18 comment on Bound git-annex add concurrency during dataset upload #1455; on nm000358 it re-read about 1.6 TB.Change
copyToAnnexRemote/copyPathsToAnnexRemoterungit annex copy --json --json-error-messagesand count success records; per-file failure messages come from the JSON.nemar-s3, and afterwards requires every annexed file in the dataset to be recorded there; otherwise the upload fails and lists them..gitattributes) fails the upload before anything is copied. Smaller ones (for exampleX.EDF, which the CLI matches case-insensitively and git-annex does not) are reported only.saveDataset(…, { skipContentCheckPaths })marks the annexed pathsassume-unchangedaroundgit add -A/status/commitand clears the flag afterwards. Deleted paths are not masked, so their removal is still staged.Behavior to know about
.edf+ 600 JSON, git 2.53, git-annex 10.20260717) the save step took 33.5 s with this change vs 6.6 s without. Locally with 2000 × 120 KB it was faster (1.47 s vs 2.4 s, two repeats each), and for large files it removes the re-read entirely (metered test below; nm000358 re-read ~1.6 TB at ~177 MB/s). The Ceph number is a single run made while another job was writing to the same filesystem, so I treat it as unexplained, but it should be re-measured on a ~15k-small-file tree before merge. If it holds, the obvious adjustment is to applyskipContentCheckPathsonly to annexed files above a size threshold (re-reading a 120 KB file is cheap; re-reading TBs is the problem). Happy to make that change if you prefer it up front.maingained unrelated commits (the adjusted branch is not rebased,clone-push.ts:155). On nm000358 that came from the availability-report sweep; that is Availability report: the sweep creates main as a root commit on a dataset that was never pushed #1643, fixed separately.Closes #1642
Part of #1455 (the save step; the tracking step is in a separate PR)
Testing
test/upload-copy-verify.unit.test.ts(new, 12 tests): real git-annex with a directory special remote. JSON copy counting; a file already at the remote is not re-sent and is counted as present; an annexed file from an earlier run missing at the remote fails the upload; a large non-annexed data file fails before copy; a small one is reported only; the save step through atee'd filter-process reads 4+ MiB without the change and under 64 KiB with it, and the commit is identical in both cases.Related suites (upload, transfer, finalize, clone-push, export surface): 225 pass, 0 fail across 15 files that import the changed modules (on this branch rebased on current
dev).bun run typecheck,biome checkon the changed files.Full
bun teston this branch plus the STS PR stacked on it (before rebasing on currentdev): 10275 pass / 21 fail; the failing tests are the same set that fails onmainon the same machine (macOS bash 3.2 completion tests, timing bounds, twoauth loginsignal tests, twoadmin usersrender tests), plus one worktree-onlynode_modulesresolution error in a backend file this branch does not touch.Not run against real S3; the remote in the tests is a directory special remote.
Save-step timing on a 15k-file Ceph tree (see above).
CI
api-testandintegration-devfail on this PR because it comes from a fork: both call the dev API with theTEST_*_API_KEYsecrets, which GitHub does not pass to fork pull requests, so the authenticated cases fail and the unauthenticated ones pass.lint,unit-pureande2e-sandboxrun normally.