Implement live read replication
This commit adds an http server and client for streaming snapshots and WAL pages from an upstream Litestream primary to a read-only replica.
This commit is contained in:
19
testdata/wal-writer/live/README.md
vendored
Normal file
19
testdata/wal-writer/live/README.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
WAL Writer Live
|
||||
=================
|
||||
|
||||
This test is to ensure we can copy a WAL file into place with a live DB and
|
||||
trigger a checkpoint into the main DB file.
|
||||
|
||||
To reproduce the data files:
|
||||
|
||||
```sh
|
||||
$ sqlite3 db
|
||||
|
||||
sqlite> PRAGMA journal_mode = 'wal';
|
||||
sqlite> CREATE TABLE t (x);
|
||||
sqlite> PRAGMA wal_checkpoint(TRUNCATE);
|
||||
sqlite> INSERT INTO t (x) VALUES (1);
|
||||
|
||||
sqlite> CTRL-\
|
||||
```
|
||||
|
||||
BIN
testdata/wal-writer/live/db
vendored
Normal file
BIN
testdata/wal-writer/live/db
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-writer/live/db-shm
vendored
Normal file
BIN
testdata/wal-writer/live/db-shm
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-writer/live/db-wal
vendored
Normal file
BIN
testdata/wal-writer/live/db-wal
vendored
Normal file
Binary file not shown.
26
testdata/wal-writer/static/README.md
vendored
Normal file
26
testdata/wal-writer/static/README.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
WAL Writer Static
|
||||
=================
|
||||
|
||||
This test is to ensure that WALWriter will generate the same WAL file as
|
||||
the `sqlite3` command line.
|
||||
|
||||
To reproduce the data file:
|
||||
|
||||
```sh
|
||||
$ sqlite3 db
|
||||
|
||||
sqlite> PRAGMA journal_mode = 'wal';
|
||||
|
||||
sqlite> CREATE TABLE t (x);
|
||||
|
||||
sqlite> INSERT INTO t (x) VALUES (1);
|
||||
|
||||
sqlite> CTRL-\
|
||||
```
|
||||
|
||||
then remove the db & shm files:
|
||||
|
||||
```sh
|
||||
$ rm db db-shm
|
||||
```
|
||||
|
||||
BIN
testdata/wal-writer/static/db-wal
vendored
Normal file
BIN
testdata/wal-writer/static/db-wal
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user