1. 8

  2. 1

    The Cockroach team itself has mentioned in the past that 500ms is a very conservative estimate. I’m sure if you’re running on AWS (that offers an atomic clock-backed NTP endpoint) you could probably lower that and opt for sleeping after every commit, like Spanner does.

    Although the above is only correct if you’re able to reliably detect if your node clock skew is within acceptable intervals. I know Cockroach will shut down a node if its clock goes outside the uncertainty interval, but that might happen after you’ve already committed a transaction with a reversed timestamp relationship.

    This post also highlights one other difference between Spanner and CRDB: Spanner explicitly distinguishes externally consistent transactions from regular transactions. If CRDB had gone that route, the causal reversal anomaly would only be exposed to those special transactions, and to solve the problem in the article you would just issue a regular transaction read-only transaction that took locks.