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

libsql/replication: Improve tracing for client #323

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

LucioFranco
Copy link
Contributor

No description provided.

@LucioFranco LucioFranco added this pull request to the merge queue Aug 25, 2023
Merged via the queue into main with commit feb93e8 Aug 25, 2023
4 checks passed
@LucioFranco LucioFranco deleted the lucio/grpc-web-part2 branch August 25, 2023 14:25
github-merge-queue bot pushed a commit that referenced this pull request Oct 17, 2023
323: Replica connection wait for replication r=MarinPostma a=MarinPostma

What this PR do is quite simple: it makes every replica database connection to wait for the replica instance to catch up with the last write that they performed.

When a replica detects a write, this write is proxied to the primary, that executes it, and then starts replicating the state. The replica receives a response that contains a logical timestamp issued after the write was performed. The replica's connection keep this timestamp and on subsequent operation on the _local_ connection, waits until the replicator has applied changes up to the stored timestamp.

Note that each connection holds a different timestamp, so a connection may proceed with a read, while another is still waiting.

The basic guarantee that it gives is read your write: a connection is always guaranteed to witness it's write. In fact the guarantee is much stronger because of the underlying consistency of sqlite, the real-time consistency model of sqld is now as strong as `sequential consistency`.


Co-authored-by: ad hoc <[email protected]>
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.

1 participant