Skip to content

fix: prevent stale deleted elements from causing lost items in concurrent GetOrInsert - #83

Open
AdamMagued wants to merge 2 commits into
cornelk:mainfrom
AdamMagued:fix-concurrent-get-or-insert
Open

AdamMagued wants to merge 2 commits into
cornelk:mainfrom
AdamMagued:fix-concurrent-get-or-insert

Conversation

@AdamMagued

Copy link
Copy Markdown

Under concurrent GetOrInsert operations, an item could be inserted adjacent to a concurrently deleted element or a deleted element could be matched during list search, leading to elements being omitted during Range traversal and counter discrepancies.

Add validation for deleted flags during list traversal, element search, and CAS insertion to ensure concurrent mutations properly retry. Add concurrent regression test TestGetOrInsertConcurrentIssue81.

Fixes #81

…rent GetOrInsert

Under concurrent GetOrInsert operations, an item could be inserted adjacent to a concurrently deleted element or a deleted element could be matched during list search, leading to elements being omitted during Range traversal and counter discrepancies.

Add validation for deleted flags during list traversal, element search, and CAS insertion. Add concurrent regression test TestGetOrInsertConcurrentIssue81.

Fixes cornelk#81
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.

There may be a bug in GetOrInsert

1 participant