Closed cool-develope closed 3 months ago
The recent updates focus on enhancing consistency, clarity, and efficiency in handling node storage and version management. Key modifications include method renaming for uniformity, improved commentary for easier understanding, and a refined approach to dealing with legacy nodes. Additionally, the logic for deleting versions has been clarified and optimized, with particular attention to batch deletions and mutex handling for safer concurrency operations. These changes aim to streamline operations and maintenance of the data structure.
File(s) | Summary of Changes |
---|---|
mutable_tree.go |
- Standardized method naming - Enhanced comments for clarity - Adjusted legacy node handling - Refined DeleteVersionsTo method documentation |
nodedb.go |
- Introduced constants for batch deletion - Renamed method for setting storage version - Reworked deletion logic for orphans and roots - Implemented batch deletion pauses - Improved mutex handling - Updated version, root, node, and orphan management methods |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Implement async pruning of legacy nodes
Fix
When the root refers to the legacy root, it will reformat the legacy node as a new node key format. This node is removed while pruning but it is still being referred by the forward version. Another issue with the reference node, it can refer to the internal node, not only the root. For example, if there are no adds, just removes, then the leaf or inner node can be the root.
nodeKey
instead of only the version as a reference node valuenodeKey
to distinguish with the root. It will also be applied for the case of when pruning the version, reformat the given root nodeKey to (version, 0).