Skip to main content

PG_CONSENSUS_READ_COMMITTED

Constant PG_CONSENSUS_READ_COMMITTED 

Source
pub const PG_CONSENSUS_READ_COMMITTED: Config<bool>;
Expand description

Flag to run PostgreSQL consensus connections under READ COMMITTED isolation instead of SERIALIZABLE.

The query family used on vanilla Postgres is linearizable under READ COMMITTED isolation and under SERIALIZABLE isolation, and remains linearizable when some connections run under each, so this flag can be flipped freely once every process runs this query family. Every operation of the family is a single statement, and a single-statement transaction takes its snapshot at the same instant under either isolation level, so the only difference between the levels is that SERIALIZABLE may additionally abort a statement with a serialization failure, which the caller retries. The flag only exists to make the upgrade path from older versions safe since multiple query versions co-exist during a 0dt upgrade. See the note on the default value for more information.

This flag should stay off on CockroachDB. The system will refuse to issue consensus queries if the flag is enabled on CockroachDB.