Repository navigation
land: storage-cross-volume - #504
aft-alfonso[bot] wants to merge 3 commits into
Conversation
…unt-point retire, per-volume preflight) Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
| fn emptied_mount_point(cache: &Path) -> bool { | ||
| crate::cross_volume::is_mount_point(cache).unwrap_or(false) | ||
| && fs::read_dir(cache).is_ok_and(|mut entries| { | ||
| entries.all(|entry| entry.is_ok_and(|entry| entry.file_name() == ".retention-trash")) | ||
| }) |
There was a problem hiding this comment.
Interrupted cleanup strands cache files
If the daemon exits after moving every entry into the mount-local .retention-trash, or deleting that trash fails, emptied_mount_point still returns true. Later passes skip the cache, and reap_retired only checks trash under the domain folder. The leftover data is never reclaimed.
Retry or reap mount-local trash before treating the mount as empty, and add an interrupted-cleanup test.
| } | ||
| crate::cross_volume::rename(&entry.path(), &retired.join(entry.file_name()))?; | ||
| } | ||
| fs::remove_dir_all(&trash) |
There was a problem hiding this comment.
Slow deletes block storage work
retire_mount_point_contents deletes the full tree before returning. Its caller still holds retention/sweep.lock and the guard from filesystem_guard, so a slow mounted volume can block new binds, pins, and SQLite file work throughout deletion. The entry limit does not bound how long disk operations take.
Leave the slow delete to a background worker, as the normal retirement path does.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Accepted agent delivery; branch-keyed search descriptor included.
Summary by cubic
Makes storage operations work when storage folders live on a separate volume, falling back to copies when a rename would cross devices instead of failing.
Cross-volume moves
cross_volume::move_pathtries a plain rename first and, on a cross-device error, copies the tree, publishes it under the destination name, and removes the source; a failed copy leaves the source untouched.EXDEVerrors without a second filesystem.Retention and migration preflight
Written for commit a7bb59f. Summary will update on new commits.
Fix mounted-cache cleanup recovery before merging so interrupted deletes do not leave files permanently stranded.
Findings
Summary
Adds cross-volume moves for legacy storage repair and checks migration space on each destination volume.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Legacy storage repair] --> B[Try rename] B -->|Success| C[Use destination] B -->|Cross-volume error| D[Copy into destination staging path] D --> E[Sync and publish copy] E --> F[Remove source] F --> C D -->|Copy fails| G[Keep source and report failure]Reviews (1) · Last reviewed commit: "release notes and search-quality descrip..." · Reviewed by Greptile