Live data from Hacker News

Why CockroachDB doesn't use EvalPlanQual

cockroachlabs.com

21–30 of 63 posts

Re: Why CockroachDB doesn't use EvalPlanQual

#24
post #3

Author here. We've spent the past year adding read committed isolation to CockroachDB. There were many interesting design decisions, such as: - whether to use multiple snapshots or a single snapshot per statement - how to handle read uncertainty intervals - how to incorporate SELECT FOR UPDATE locking into Raft - how to handle SELECT FOR UPDATE subqueries - how to prevent lost update anomalies between two UPDATEs Som…

Why is Cockroach adding READ COMMITTED? Is using a lower level of isolation better for performance or just reduces the amount of serialization errors and retries that need to be done?

Re: Why CockroachDB doesn't use EvalPlanQual

#25
post #2

It's often talked about how new sql databases offer better scalability than standard SQL databases, but I think it's maybe sometimes underappreciated how (some, not all) of them are also much simpler in terms of their consistency models. I'd speculate this is because postgres and friends try to eek out every bit of single node performance (which helps with single row throughout and overall throughout, which is obviou…

Read committed is explicitly asking for hard mode. If you want a simple life stick with Serializable as always. It took years before people found anomalies in Repeatable Read in Postgres. This stuff is hard even for world class researchers.

Re: Why CockroachDB doesn't use EvalPlanQual

#26
post #24
post #3

Author here. We've spent the past year adding read committed isolation to CockroachDB. There were many interesting design decisions, such as: - whether to use multiple snapshots or a single snapshot per statement - how to handle read uncertainty intervals - how to incorporate SELECT FOR UPDATE locking into Raft - how to handle SELECT FOR UPDATE subqueries - how to prevent lost update anomalies between two UPDATEs Som…

Why is Cockroach adding READ COMMITTED? Is using a lower level of isolation better for performance or just reduces the amount of serialization errors and retries that need to be done?

The main motivation is reduce serialization errors, for applications that can handle the weaker isolation level. Especially for applications that were previously running fine under RC on another database.

Re: Why CockroachDB doesn't use EvalPlanQual

#28

How does the CockroachDB approach not deadlock? Surely retrying could encounter a situation where two competing UPDATE will lock rows in different order, and no amount of retrying will unlock the required rows, right?

I wondered this too and found this in the docs[0]:

  Transactions at all isolation levels are subject to lock contention, where a transaction attempts to lock a row that is already locked by a write or
  locking read. In such cases, the later transaction is blocked until the earlier transaction commits or rolls back, thus releasing its lock on the row.
  Lock contention that produces a deadlock between two transactions will result in a transaction abort and a 40001 error
  (ABORT_REASON_ABORTED_RECORD_FOUND or ABORT_REASON_PUSHER_ABORTED) returned to the client.
So looks like you still get a good old 40001 error just like with SERIALIZABLE isolation.

[0] - https://www.cockroachlabs.com/docs/stable/read-committed#rea...

Re: Why CockroachDB doesn't use EvalPlanQual

#29
post #21

[flagged]

Sometimes, I like to open The GIMP so I can take the logo for the Coq proof assistant, export it and commit it into the HEAD of my Git repository. I think the weird names are fine, it's the management that needs fixing.

If not for git, you could have to commit to Subversion! And then back up the whole thing with Duplicity.

I'm not a fan of such sense of humor, and prefer neutral monikers like rsync, or Xfce, or Linux, but the ship has sailed.

It just gets normalized and the edginess erased with time and daily use. Imagine that somebody would suggest that you have to wash your hair with some "sham poo". They would be laughed out of the room, had not this word existed for centuries.

Post reply on HN