fix(trash): trash a gone folder whole, files in chunks of 50 - #8
Merged
Merged
Conversation
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
Runs 39, 40 and 41 (github 34956677315, 34962546482, 34988879529) all died in
trashon the same folder: onefilesystem trashcall with 232 paths for.../CS35L/Assignments/1/1/ccle/processed/. The CLI resolves paths one after another at about two seconds each (133 paths took 261 s in the state's commands table), so the call cannot beat the 300 scommand_timeout_seconds, and_mutationnever retries. The report phase pushes state even on failure, so every later run resumed at the identical folder and died the same way.Beyond that folder, 24 of the 4,124 remaining folders hold over 200 files and
/Media/iPhone 2016/holds 4,570. File-by-file trashing needs roughly 20 hours of CLI time across many chained runs.Change
_unitsfinds the topmost directories with no livemirror_objectsrow beneath them and issues onefilesystem trashon the folder node; every deleted row under it is recordedTRASHEDand dropped. Against the current state this covers 36,722 of the 36,723 remaining files in 34 calls. Reconcile already trashes stray folders the same way.TRASH_CHUNK), each chunk's rows recorded and dropped as the call returns, so a call that dies loses at most one chunk of bookkeeping.subtrees.Test plan
task test: 156 passed, including two new cases: a gone tree goes in one call while a mixed folder trashes by name; chunked calls settle each chunk before the next and a failing call leaves the rest for the next runtask lint,task check(render unchanged)sync, watch the trash phase log forfolder N of ~35lines withsubtreescounts andtask statusmirrored files fall toward the inventory count