Repository navigation
fix: drop the rows of a directory moved out of the watched root - #1118
Merged
Merged
Conversation
Red for #1109. inotify reports the move as one event naming the directory and none for the files beneath it; the rows those files produced currently linger until a cold rescan. Two watch integration tests (move out of the root, rename within it, asserting only the disappearing side) and one CLI e2e test.
inotify reports a directory renamed out of (or within) the root as one event naming the directory and none for the files beneath it, so their rows lingered until a cold rescan. On a Deleted event the watcher now also deletes every row recorded under `<path>/` in every table, one Delete event per file, the same as if each file had been removed alone. `Db::files_under` lists the distinct (table, file_path) pairs beneath a directory; `delete_subtree` in `process_file_event` drives the existing per-file delete over them. Fixes #1109
The stale release-ci check runs left on the previous sha carry version numbers willfire no longer predicts, so CI Gate reports them as unpredicted checks and cannot confirm the set is complete.
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.
Fixes #1109
Problem
A directory moved out of the watched root (or renamed within it) leaves behind every row its files produced. They persist until a cold rescan.
Root cause
inotify reports the move as one
IN_MOVED_FROMnaming the directory and nothing for the files beneath it.translate_eventmaps it toFileEvent::Deleted(<dir>);process_file_eventmatches the directory path against the table globs andhandle_deletedeletes by exactfile_path, so at most a row for the directory itself (which never exists) is removed. The mirror case, a directory moved in, was #1096 / #1110.Fix
Red first: this PR currently carries only the failing tests. Implementation follows once CI red is witnessed.
Red/green
dir_moved_out_of_root_deletes_its_rowsanddir_renamed_within_root_deletes_rows_under_old_nameinpackages/rust/tests/watch_scan_correctness.rs(the rename test asserts only the disappearing side; the appearing side is Watch: a directory moved into the root is never indexed #1096's), andserver_drops_the_rows_of_a_directory_moved_out_of_the_rootinpackages/rust/tests/cli_e2e.rs.rows: ["leaving/one/deep.txt", "leaving/a.txt", "keep.txt"],rows: ["a/x.txt", "b/x.txt"],rows: ["Hello-World.json", "Second-Post.json"]).E2E Verification
packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)Changelog / Migrations
<root>/<pkg>/changelog.d/for each changed package (or:skip-changelogtrailer on a commit with reason)<root>/<pkg>/migrations.d/(or: not required -- additive/bugfix only)Parity
Parity maintained, no drift. Watcher behavior fix in the shared Rust core; no SDK public surface changes.
PARITY.mdentry lands with the implementation commit.