This PR implements a restricted form of online DDL. It permits concurrent read-only DML when a schema migration task is in progress.
Currently you can already do non-blocking DDL with regular transactions, but that has a few limitations:
Schema migrations in a large database usually take a long time, and are likely to be indefinitely starved by concurrent small transactions in a busy system.
A transaction can write at most 50,000 pages of data. This forces the application developer to split a schema migration into multiple smaller transactions, and the application may see inconsistent data in between.
This PR introduces single-writer lock, which when enabled permits only a single writer, the schema migration task, to write to the database. All other tasks see the latest consistent snapshot before the lock.
Related: https://github.com/losfair/mvsqlite/issues/70
This PR implements a restricted form of online DDL. It permits concurrent read-only DML when a schema migration task is in progress.
Currently you can already do non-blocking DDL with regular transactions, but that has a few limitations:
This PR introduces single-writer lock, which when enabled permits only a single writer, the schema migration task, to write to the database. All other tasks see the latest consistent snapshot before the lock.