Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmsc818ePublicF2021b
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Keleher
cmsc818ePublicF2021b
Commits
104a2773
Commit
104a2773
authored
3 years ago
by
Peter J. Keleher
Browse files
Options
Downloads
Patches
Plain Diff
auto
parent
bec0f938
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notes/spannerCockroach.md
+16
-9
16 additions, 9 deletions
notes/spannerCockroach.md
with
16 additions
and
9 deletions
notes/spannerCockroach.md
+
16
−
9
View file @
104a2773
...
@@ -110,17 +110,20 @@ external consistency known as “linearizability.”
...
@@ -110,17 +110,20 @@ external consistency known as “linearizability.”
-
"in a non-distributed database, serializability implies linearizability"
-
"in a non-distributed database, serializability implies linearizability"
-
single clock
-
single clock
-
if T2 starts after T1 finishes, that will be equiv serial order, and so...
-
if T2 starts after T1 finishes, that will be equiv serial order, and so...

-
"CockroachDB’s external consistency guarantee is by default only
-
"CockroachDB’s external consistency guarantee is by default only
serializability, though with some features that can help bridge the gap in
serializability, though with some features that can help bridge the gap in
practice."
practice."
The anomaly of "causal reverse":
!
[
blah
](
cockroachUnsync.png
)
TrueTime gives clocks skew upper bound of 7ms (as opposed to 100-250ms).
"Before a node is allowed to report that a transaction has committed, it must
"Before a node is allowed to report that a transaction has committed, it must
wait 7ms. Because all clocks in the system are within 7ms of each other,
wait 7ms.
**
Because all clocks in the system are within 7ms of each other,
waiting 7ms means that no subsequent transaction may commit at an earlier
waiting 7ms means that no subsequent transaction may commit at an earlier
timestamp, even if the earlier transaction was committed on a node with a
timestamp
**
, even if the earlier transaction was committed on a node with a
clock which was fast by the maximum 7ms"
clock which was fast by the maximum 7ms
.
"
Approach:
Approach:
-
"The possibility of reordering commit timestamps for causally related
-
"The possibility of reordering commit timestamps for causally related
...
@@ -129,17 +132,19 @@ Approach:
...
@@ -129,17 +132,19 @@ Approach:
-
"What
*could*
happen is that examining the database at a historical timestamp
-
"What
*could*
happen is that examining the database at a historical timestamp
might yield paradoxical situations where transaction A is not yet visible
might yield paradoxical situations where transaction A is not yet visible
while transaction B is, even though transaction A is known to have preceded
while transaction B is, even though transaction A is known to have preceded
B, as they’re causally related. However, this can only happen if there’s no
B, as they’re causally related. However,
**this can only happen if**
:
overlap between the keys read or written during the transactions."
-
there’s no overlap between the keys read or written during the transactions.
-
there’s an external low-latency communication channel between clients that
could potentially impact activity on the DBMS.
## Approach
## Approach
**causality token**
- max timestamp encountered (anywhere) in a transaction.
**causality token**
- max timestamp encountered (anywhere) in a transaction.
-
used to ensure that causal chains maintained by serving as minimum commit
-
used to ensure that causal chains maintained by serving as minimum commit
timestamp for that transaction.
timestamp for that transaction.
-
doesn't help w/ independent causal chains
**Another Problem:**
**Problem:**
-
*Ti*
reading data from mult nodes might fail to read already-committed data
-
*Ti*
reading data from mult nodes might fail to read already-committed data
**Solution:**
**Solution:**
...
@@ -158,7 +163,9 @@ Approach:
...
@@ -158,7 +163,9 @@ Approach:
So:
So:
-
spanner always short-waits on writes for short interval (~7ms)
-
spanner always short-waits on writes for short interval (~7ms)
-
cockroachdb sometimes long waits on reads (~250ms)
-
cockroachdb delay:
-
often fast (one or two rounds, maybe 5ms)
-
sometimes long waits on reads (~250ms)
-
causal reverse still possible (though probably not a problem in practice)
-
causal reverse still possible (though probably not a problem in practice)
Strict serializability makes all of the guarantees of one-copy serializability
Strict serializability makes all of the guarantees of one-copy serializability
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment