google / btree

BTree provides a simple, ordered, in-memory data structure for Go programs.
Apache License 2.0
3.9k stars 414 forks source link

fix: remove item may changed clone btree; (i+1) children has new cow,… #58

Closed zhangchuanqing5658 closed 2 weeks ago

zhangchuanqing5658 commented 2 months ago

… but do not copy

zhangchuanqing5658 commented 2 months ago

bug flow new btree t1 clone btree t2 remove item and need merge i + 1 children. now, i + 1 children has new cow, but no copy; t1 modiyf i + 1 children item, t2 follow modify (bug happen).

fix: when merge i + 1 children, copy it