Refactor Restore()
This commit refactors out the complexity of downloading ordered WAL files in parallel to a type called `WALDownloader`. This makes it easier to test the restore separately from the download.
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
To reproduce this testdata, run sqlite3 and execute:
|
||||
|
||||
PRAGMA journal_mode = WAL;
|
||||
CREATE TABLE t (x);
|
||||
INSERT INTO t (x) VALUES (1);
|
||||
INSERT INTO t (x) VALUES (2);
|
||||
|
||||
And copy & split the WAL into segments:
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000000 db-wal
|
||||
cp db-wal 00000000.wal
|
||||
|
||||
|
||||
Then execute:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
INSERT INTO t (x) VALUES (3);
|
||||
|
||||
And split again:
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000001 db-wal
|
||||
cp db-wal 00000001.wal
|
||||
|
||||
|
||||
Then execute:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
INSERT INTO t (x) VALUES (4);
|
||||
INSERT INTO t (x) VALUES (5);
|
||||
|
||||
And split again:
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000002 db-wal
|
||||
cp db-wal 00000002.wal
|
||||
|
||||
|
||||
Finally, remove the original database files:
|
||||
|
||||
rm db*
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user