* consume stream completely in order to avoid test deadlock
- reproduced pretty stabily with rr record --chaos
- slack thread: https://turso.slack.com/archives/C044XT6KK46/p1721393397388469
* moved nextest config to the default location and fix toml
* Return also Program from Connection::run
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Extract LibSqlConnection::execute
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Use LibSqlConnection::execute in write_proxy
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Remove Clone from Program
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Remove Arc from Program
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Allow a single transaction in schema migration
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* fix rustc-hash dep issue
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
---------
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
Old implementation could never finish if the write is faster than
time needed to do two round-trips to primary.
For example it's enough to have a write every 200ms to make sync
never finish if it's done in embedded replica in Sydney
if the primary and the writer are in the US.
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
This commit fixes an issue where new connections for embedded replica's
with write delegation would not create a new "connection" on the server
causing weird issues with transactions and state. The fix here is to
create a new `client_id` when creating a new writer for a new connection
locally. This forces the server to use separate connections to execute
the writes.
Closes#1283
* server: fix conflict on attach update
* add tests and add on conflict to other branch
* only error on server errors
* remove test query
* add more on conflicts fixes
* Revert "add more on conflicts fixes"
This reverts commit 9cef2d320e.
* remove replace for meta store inserts
* Hrana: don't close the stream at the end of prepared statement execution
* hrana stream and transaction: check for tokio runtime existence on drop
* standalone::execute_transaction test: raise simulation duration
* hrana: added comments to conditions for stream closing
* hrana: added comments to conditions for stream closing
- Added a test which performs data migration including
inserts, updates and deletes
- Added a test which shows that schema migration fails
if there is any conflicting data in the linked dbs
* Fork a new DB when creating from shared schema
* Use the correct db type to get the wal logger
* Add a test for a new db in shared schema
- When a new db is created with a shared schema, it should have
the same schema and the schema version
- When a new migration is done, the new db and all the existing
dbs should have the same schema and version
* Move schema db fork logic inside namespace mod
* clean up and remove unnecessary store call
* Add block_writes to Connection
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Add block_writes to PrimaryDatabase
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Use block_writes in Connection::run
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Unblock writes once migration is finished
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Block writes on startup if there are pending migration tasks
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* Block writes when a migration task is enqueued
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
* twix
---------
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
Co-authored-by: ad hoc <postma.marin@protonmail.com>
* added an endpoint to ask for a general migration status
* return detailed information about individual migration job progress
* integrated migrations API in tests
* post-rebase
* adjusted code after rebase
There's no reason to have `is_autocommit()`, `changes()` or
`last_insert_row()` methods async because they're all fully local and
cannot block. Deasyncify them.
* Add a regression test when UUIDs are used in attach
statements
Also, added a test to check if the UUID is wrapped
in quotes
* bugfix: trim namespace string if it is wrapped in quotes
the client might send namespace wrapped in quotes in case of uuids,
so we will just trim the string.