-
Notifications
You must be signed in to change notification settings - Fork 15
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
shardtree: Use annotated parent nodes with empty children for inserted frontier ommers. #107
Conversation
shardtree/src/prunable.rs
Outdated
let LocatedTree { root_addr, root } = self; | ||
if root_addr.contains(&subtree.root_addr) { | ||
go(*root_addr, root, subtree, contains_marked).map(|(root, incomplete)| { | ||
let new_tree = LocatedTree { | ||
root_addr: *root_addr, | ||
root, | ||
}; | ||
assert!(new_tree.max_position() >= max_position); |
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.
The removal of this assertion is intentional; given the way that shardtree
was used prior to this PR, it is not possible to determine whether a Node::Leaf
value in a persisted tree was present as a pruned subtree root, or because of direct insertion as a shard root or the ommer of an inserted frontier. In general, the maximum position of populated nodes within a subtree should only be used when considering the maximum inserted position of the overall tree.
3b66ad3
to
68935c8
Compare
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.
Reviewed 68935c8.
@@ -235,17 +235,15 @@ impl< | |||
|
|||
let (append_result, position, checkpoint_id) = | |||
if let Some(subtree) = self.store.last_shard().map_err(ShardTreeError::Storage)? { | |||
match subtree.max_position() { | |||
// If the subtree is full, then construct a successor tree. |
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.
Keep this comment?
Also, fix the clippy lints :) |
The current behavior of `unite` incorrectly discards annotation data.
25242e2
to
ca3e553
Compare
In 7e48886, `Node::Pruned` was introduced in order to fix problems with `LocatedTree::max_position` resulting from reinsertion of subtree information as children of a previously pruned subtree represented by a `Node::Leaf` at its root. This fix introduced a large amount of complexity that is better resolved by fixing the `max_position` function in a different way and generally minimizing its usage.
ca3e553
to
192cb3f
Compare
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.
utACK 192cb3f
No description provided.