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

Store.syncSegments() must sync root segment *last* #51

Open
clarisma opened this issue Nov 15, 2022 · 2 comments
Open

Store.syncSegments() must sync root segment *last* #51

clarisma opened this issue Nov 15, 2022 · 2 comments
Labels
todo A feature that has been specified, but not yet implemented

Comments

@clarisma
Copy link
Owner

Important at the end of a transaction:

  • If segments are synced in arbitrary order, this could create a race condition (index entries visible before tile data)
  • does not affect consumers blocking on a request (signaled once transaction finished), or processes waiting on lock (only released at tx end)
  • But another process checking the index may see that a tile is presented, when in reality its data is still being written!
@clarisma clarisma added the todo A feature that has been specified, but not yet implemented label Nov 15, 2022
@clarisma
Copy link
Owner Author

Must write index last, not just root segment.

@clarisma
Copy link
Owner Author

Could establish explicit write order for blocks. Maybe: markSequential(long pos) with auto-increment count. Blocks are written in count order. Blocks with count 0 can be written in arbitrary order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo A feature that has been specified, but not yet implemented
Projects
None yet
Development

No branches or pull requests

1 participant