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

obsoleteness detection in lookupRange() of ARTOLC causes an infinite loop #6

Open
chahk0129 opened this issue Oct 5, 2021 · 1 comment

Comments

@chahk0129
Copy link

Hi, I found an issue with getChillren() function in line 103 of Tree.cpp inside lookupRange() of ARTOLC implementation.

N::getChildren(node, 0u, 255u, children, childrenCount);

When it is directed to each specific node type, e.g., Node4, Node16, Node48, Node256, it checks if it needs to restart upon read-write conflicts.

When conflict is detected, it restarts locally, but this can cause an infinite loop when running with write operations.
The dynamic node adjustment replaces a node with a larger/smaller node, which marks the original obsolete and reclaimed. However, when running concurrent queries of range lookups with a mixture of write operations such as insert and remove, threads executing range queries keep trying locally to collect child pointers due to obsoleteness detection which will never succeed.

I think the getChildren() in each node type should either

  • distinguish the write latch acquisition state and obsolete state, and when obsolete, retry from parent (may recursively backtrack up).
  • abort upon conflicts, and retry globally (from the root).
@flode
Copy link
Owner

flode commented Oct 9, 2021

Hey, yes good catch. And it's not only the getChildren function that has this issue, in the findStart and findEnd helpers there are also local retries that can run into an infinite loop.
Both of the proposed solutions would solve this.

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

No branches or pull requests

2 participants