mirror of
https://github.com/aziascreations/BakaShrot.git
synced 2026-11-23 20:58:46 +01:00
Stopped writing once SQLite rolled a batch back
- SQLite may roll a whole transaction back by itself (a full disk, an I/O error, out of memory). The writes after it then ran outside any transaction, each committed alone, while the batch failed and every write was answered ServerError: a retried push stored twice - Every Batch operation after is refused now (Error::RolledBack, Batch::is_rolled_back), the batch fails, nothing in it stored; the server's writer stops running the group there - batch.rs nothing_runs_once_sqlite_rolled_back (a ROLLBACK standing in for SQLite's); docs (storage.md) and revamp.md (step 18) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,17 @@ operation of a `Batch` is all or nothing on its own (a savepoint), so a
|
||||
batch goes on after one fails: the server queues pushes and stores them
|
||||
together, one disk flush for all.
|
||||
|
||||
Except when SQLite rolls the whole transaction back by itself, which it
|
||||
may on a full disk, an I/O error or out of memory (`Batch::is_rolled_back()`).
|
||||
What came after then ran outside any transaction, each operation
|
||||
committed alone, while the batch failed and every write in it was
|
||||
answered as failed: a retried push stored twice. Since 2026-11-19 every
|
||||
operation after is refused (`Error::RolledBack`) and so is the batch:
|
||||
nothing in it is stored, every write answered `ServerError`
|
||||
(`nothing_runs_once_sqlite_rolled_back` in `batch.rs`, a `ROLLBACK`
|
||||
standing in for SQLite's). The server's writer stops running the group
|
||||
there.
|
||||
|
||||
| Operation | What |
|
||||
|---|---|
|
||||
| `push(topic, node, pushed_at, data)` | the next id of its stream, which it returns; the stream is made if new |
|
||||
|
||||
Reference in New Issue
Block a user