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

Race in NodeStorageService.store #10448

Open
rymsha opened this issue Mar 8, 2024 · 0 comments
Open

Race in NodeStorageService.store #10448

rymsha opened this issue Mar 8, 2024 · 0 comments
Labels

Comments

@rymsha
Copy link
Contributor

rymsha commented Mar 8, 2024

It may theoretically happen in

  • node with the id does not exist
  • node id is exactly the same
  • two threads or instances write at the same time
  • one thread/instance manages to overtake another
nodeServvice.checkExists <- return false for thread 1 and 2
versionIndex.store
branchIndex.store 
<-------------------- thread 2 overtakes thread 1
searchIndex.store

in this case branchIndex will have data for thread 2 (last write wins) but searchIndex will have data for thread 1

If nodes are different (data, path, permissions, etc) it is a big problem. For entirely equal nodes search index will have wrong nodeVersion Id (it is called _versionkey in search index) and maybe timestamp (_ts).

@rymsha rymsha added the Bug label Mar 8, 2024
@rymsha rymsha changed the title race in NodeStorageService.store Race in NodeStorageService.store Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant