Skip to content
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

fix tree corruption upon delete then insert #39

Merged
merged 1 commit into from
Aug 13, 2022
Merged

fix tree corruption upon delete then insert #39

merged 1 commit into from
Aug 13, 2022

Conversation

fumin
Copy link
Contributor

@fumin fumin commented Aug 13, 2022

This data corruption is due to the fact that entries of different nodes share the same slice.
For example, assume

nodeA.entries == buf[:3]
nodeB.entries == buf[3:]

when we do

nodeA.entries = append(nodeA.entries, foo)

we accidentally make nodeB.entries[0] == foo
and nodeB's data is corrupted.

This issue is likely the cause behind
#28

This data corruption is due to the fact that entries of different nodes share the same slice.
For example, assume

nodeA.entries == buf[:3]
nodeB.entries == buf[3:]

when we do

nodeA.entries = append(nodeA.entries, foo)

we accidentally make nodeB.entries[0] == foo
and nodeB's data is corrupted.

This issue is likely the cause behind
#28
@dhconnelly
Copy link
Owner

This is great! Thank you!

@dhconnelly dhconnelly merged commit 88e5102 into dhconnelly:master Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants