-
Notifications
You must be signed in to change notification settings - Fork 10
Rework clean and iter_objects for topological traversal #1288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: push-volovwxpnxry
Are you sure you want to change the base?
Conversation
b313368 to
74f07c7
Compare
25d9c79 to
50b5ce6
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
50b5ce6 to
b405511
Compare
b405511 to
ba586aa
Compare
2640233 to
9ef4438
Compare
ba586aa to
9aae863
Compare
To address the problem demonstrated in #1282, clean needs to delete things in a top-level order, and skip cleaning children of anything deemed uncleanable. The plan is to make iter_objects (now iter_items) return more detailed information including what the item's parent(s) are, so that the consumer of the stream can build up a graph of items. Since iter_items can be called over RPC and used as a stream, it isn't practical to compute the entire graph and return it in a single response. But the stream items can be used to build up the graph incrementally. Signed-off-by: J Robert Ray <jrray@jrray.org>
This is only true when there are no concurrent writers! This is the test from #1282 but passes as of the changes in this PR. Signed-off-by: J Robert Ray <jrray@jrray.org>
9ef4438 to
1c49e90
Compare
9aae863 to
8fecf80
Compare
| let mut dfs = Dfs::new(&g, node_idx); | ||
| while let Some(n) = dfs.next(&g) { | ||
| let node = idx_to_node.get(&n).unwrap(); | ||
| attached_nodes.insert(node.digest()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self, this should also mark these objects as attached in self.attached.
| let mut dfs = Dfs::new(&g, node_idx); | ||
| while let Some(n) = dfs.next(&g) { | ||
| let node = idx_to_node.get(&n).unwrap(); | ||
| attached_nodes.insert(node.digest()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self, this should also mark these objects as attached in self.attached.
rydrman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reminding that you have a couple of notes to self on this one, in case you intend to resolve those still
To address the problem demonstrated in #1282, clean needs to delete things in a top-level order, and skip cleaning children of anything deemed uncleanable.
The plan is to make iter_objects (now iter_items) return more detailed information including what the item's parent(s) are, so that the consumer of the stream can build up a graph of items. Since iter_items can be called over RPC and used as a stream, it isn't practical to compute the entire graph and return it in a single response. But the stream items can be used to build up the graph incrementally.
It's working as a proof of concept (as in all tests pass) but I didn't update the rpc repo type for these changes
and handling payloads is unfinished. I'm surprised it even compiles with the server feature enabled, as I was avoiding turning that feature on until I got the basics working.Edit: I see, object iteration over rpc isn't supported.
spk/crates/spfs/src/server/database.rs
Lines 74 to 81 in 8b75563