2 ms·
In subversion writes replaced a node, then replaces the parent node all the way up to the root. So anyone doing a read in the middle of a merge only sees the ol
by hinkley 2y ago
In subversion writes replaced a node, then replaces the parent node all the way up to the root. So anyone doing a read in the middle of a merge only sees the old data because it saw the old root node. I assume MVCC systems do something similar, but for others I would think a lock per node allows for a lot less contention. And your project then relies very much on good indexes to avoid reading rows and thus parent nodes you don’t need.
- p_l 2y agoMost MVCC but also some filesystems (ZFS) and various thread safe functional data structures use similar pattern of instead of actually modifying a tree they make new nodes that refer to old and new nodes then finally replace the tree root pointer atomically.