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

Should clarify batch operation's atomicity and consistency levels #54

Open
Mossaka opened this issue Oct 31, 2024 · 1 comment
Open

Comments

@Mossaka
Copy link
Collaborator

Mossaka commented Oct 31, 2024

According to the description of the batch interface

/// A batch operation does not guarantee atomicity, meaning that if the batch operation fails, some
/// of the keys may have been modified and some may not. 
/// 
/// This interface does has the same consistency guarantees as the `store` interface, meaning that
/// you should be able to "read your writes."

batch operations are said to be non-atomic, which implies partial failure and inconsistent reads, while the "read your writes" guarantee ensures consistent reads post-writing.

think about this example

  1. Client A's batch operation starts.
  2. Client A successfully writes V1_new to K1.
  3. Before Client A writes to K2, Client B writes V2_b to K2
  4. Client A attempts to write V2_new to K2 but fails

Resulting State:
K1: V1_new
K2: V2_b

Client A cannot read its own write to K2 because Client B's concurrent write interfered, and this contradicts the statement that "you should be able to 'read your writes'".

@thomastaylor312
Copy link
Collaborator

I'm not sure I follow your example. If Client A fails to write because another process wrote to it, then by reason of it failing, it wouldn't be able to read something that failed.

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