-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Detect Deleted Nodes That Should Be Restored
The Core Issue:
When one client modifies children of a node and another client deletes the parent node (before seeing the modifications), the deletion operation will delete the parent, causing the children to become orphaned. This effectively loses the work made by the first client on those children.
Current Behavior
When apply_delete() is called:
- The deleted node is detached from its parent
- The node is marked as tombstoned
- Children of the deleted node remain in the tree but become orphaned (they still exist but have no parent reference)
- Any modifications made to these children before the deletion arrived are preserved in the tree structure, but the parent-child relationship is lost
Functional Requirements
- Preserve User Work: Modifications made to children before parent deletion should not be lost
- Maintain Tree Integrity: Parent-child relationships should be preserved when possible
- Conflict Detection: System should detect when deletions conflict with modifications
- CRDT Semantics: Solution must maintain eventual consistency across all replicas
- Operation Ordering: Solution must handle out-of-order operation delivery correctly
- Idempotency: Applying the same operation multiple times should have the same effect
Proposed Implementation
Implement algorithm to find nodes which should be restored in order to preserve work. This algorithm should return list of nodes to restore. Also need to implement restore function which restore last valid parent of node.
In this case responsibility to merge conflict can be delegated to client side.
marcus-pousette
Metadata
Metadata
Assignees
Labels
No labels