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:
8
testdata/Makefile
vendored
Normal file
8
testdata/Makefile
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
make -C find-latest-generation/ok
|
||||
make -C generation-time-bounds/ok
|
||||
make -C generation-time-bounds/snapshots-only
|
||||
make -C replica-client-time-bounds/ok
|
||||
make -C snapshot-time-bounds/ok
|
||||
make -C wal-time-bounds/ok
|
||||
0
testdata/find-latest-generation/no-generations/.gitignore
vendored
Normal file
0
testdata/find-latest-generation/no-generations/.gitignore
vendored
Normal file
7
testdata/find-latest-generation/ok/Makefile
vendored
Normal file
7
testdata/find-latest-generation/ok/Makefile
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000000/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/snapshots/00000001.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000001/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001030000 generations/0000000000000001/snapshots/00000001.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000002/snapshots/00000000.snapshot.lz4
|
||||
BIN
testdata/find-latest-generation/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/find-latest-generation/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/find-latest-generation/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/find-latest-generation/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/find-latest-generation/ok/generations/0000000000000001/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/find-latest-generation/ok/generations/0000000000000001/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/find-latest-generation/ok/generations/0000000000000001/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/find-latest-generation/ok/generations/0000000000000001/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/find-latest-generation/ok/generations/0000000000000002/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/find-latest-generation/ok/generations/0000000000000002/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
testdata/find-snapshot-for-index/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/find-snapshot-for-index/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/find-snapshot-for-index/ok/generations/0000000000000000/snapshots/000003e8.snapshot.lz4
vendored
Normal file
BIN
testdata/find-snapshot-for-index/ok/generations/0000000000000000/snapshots/000003e8.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/find-snapshot-for-index/ok/generations/0000000000000000/snapshots/00000bb8.snapshot.lz4
vendored
Normal file
BIN
testdata/find-snapshot-for-index/ok/generations/0000000000000000/snapshots/00000bb8.snapshot.lz4
vendored
Normal file
Binary file not shown.
8
testdata/generation-time-bounds/ok/Makefile
vendored
Normal file
8
testdata/generation-time-bounds/ok/Makefile
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000000/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/snapshots/00000001.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000000/wal/00000000/00000000.wal.lz4
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/wal/00000000/00000001.wal.lz4
|
||||
TZ=UTC touch -t 200001030000 generations/0000000000000000/wal/00000001/00000000.wal.lz4
|
||||
|
||||
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/wal/00000000/00000001.wal.lz4
vendored
Normal file
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/wal/00000000/00000001.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
BIN
testdata/generation-time-bounds/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
5
testdata/generation-time-bounds/snapshots-only/Makefile
vendored
Normal file
5
testdata/generation-time-bounds/snapshots-only/Makefile
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000000/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/snapshots/00000001.snapshot.lz4
|
||||
|
||||
Binary file not shown.
Binary file not shown.
0
testdata/max-index/no-snapshots/generations/0000000000000000/.gitignore
vendored
Normal file
0
testdata/max-index/no-snapshots/generations/0000000000000000/.gitignore
vendored
Normal file
BIN
testdata/max-index/no-wal/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/max-index/no-wal/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/no-wal/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/max-index/no-wal/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/max-index/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/max-index/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000000/00001234.wal.lz4
vendored
Normal file
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000000/00001234.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000002/00000000.wal.lz4
vendored
Normal file
BIN
testdata/max-index/ok/generations/0000000000000000/wal/00000002/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
testdata/max-snapshot-index/no-snapshots/generations/0000000000000000/.gitignore
vendored
Normal file
0
testdata/max-snapshot-index/no-snapshots/generations/0000000000000000/.gitignore
vendored
Normal file
6
testdata/max-snapshot-index/ok/Makefile
vendored
Normal file
6
testdata/max-snapshot-index/ok/Makefile
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000001/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001030000 generations/0000000000000001/snapshots/00000001.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000002/snapshots/00000000.snapshot.lz4
|
||||
BIN
testdata/max-snapshot-index/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/max-snapshot-index/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-snapshot-index/ok/generations/0000000000000000/snapshots/000003e8.snapshot.lz4
vendored
Normal file
BIN
testdata/max-snapshot-index/ok/generations/0000000000000000/snapshots/000003e8.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-snapshot-index/ok/generations/0000000000000000/snapshots/000007d0.snapshot.lz4
vendored
Normal file
BIN
testdata/max-snapshot-index/ok/generations/0000000000000000/snapshots/000007d0.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-wal-index/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/max-wal-index/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-wal-index/ok/generations/0000000000000000/wal/00000000/00001234.wal.lz4
vendored
Normal file
BIN
testdata/max-wal-index/ok/generations/0000000000000000/wal/00000000/00001234.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/max-wal-index/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
BIN
testdata/max-wal-index/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
6
testdata/replica-client-time-bounds/ok/Makefile
vendored
Normal file
6
testdata/replica-client-time-bounds/ok/Makefile
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000001/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001030000 generations/0000000000000001/snapshots/00000001.snapshot.lz4
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000002/snapshots/00000000.snapshot.lz4
|
||||
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000001/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000001/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000001/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000001/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000002/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/replica-client-time-bounds/ok/generations/0000000000000002/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/bad-permissions/00000000.db
vendored
Normal file
BIN
testdata/restore/bad-permissions/00000000.db
vendored
Normal file
Binary file not shown.
36
testdata/restore/bad-permissions/README
vendored
Normal file
36
testdata/restore/bad-permissions/README
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000000 db-wal
|
||||
cp db generations/0000000000000000/snapshots/00000000.snapshot
|
||||
lz4 -c --rm generations/0000000000000000/snapshots/00000000.snapshot
|
||||
|
||||
|
||||
Then execute:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
INSERT INTO t (x) VALUES (3);
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000001 db-wal
|
||||
|
||||
|
||||
Then execute:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
INSERT INTO t (x) VALUES (4);
|
||||
INSERT INTO t (x) VALUES (5);
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000002 db-wal
|
||||
|
||||
|
||||
Finally, obtain the final snapshot:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
|
||||
cp db 00000002.db
|
||||
rm db*
|
||||
|
||||
BIN
testdata/restore/bad-permissions/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/restore/bad-permissions/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/00000002.db
vendored
Normal file
BIN
testdata/restore/ok/00000002.db
vendored
Normal file
Binary file not shown.
36
testdata/restore/ok/README
vendored
Normal file
36
testdata/restore/ok/README
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000000 db-wal
|
||||
cp db generations/0000000000000000/snapshots/00000000.snapshot
|
||||
lz4 -c --rm generations/0000000000000000/snapshots/00000000.snapshot
|
||||
|
||||
|
||||
Then execute:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
INSERT INTO t (x) VALUES (3);
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000001 db-wal
|
||||
|
||||
|
||||
Then execute:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
INSERT INTO t (x) VALUES (4);
|
||||
INSERT INTO t (x) VALUES (5);
|
||||
|
||||
sl3 split -o generations/0000000000000000/wal/00000002 db-wal
|
||||
|
||||
|
||||
Finally, obtain the final snapshot:
|
||||
|
||||
PRAGMA wal_checkpoint(TRUNCATE);
|
||||
|
||||
cp db 00000002.db
|
||||
rm db*
|
||||
|
||||
BIN
testdata/restore/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000000/00002050.wal.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000000/00002050.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000002/00000000.wal.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000002/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000002/00001038.wal.lz4
vendored
Normal file
BIN
testdata/restore/ok/generations/0000000000000000/wal/00000002/00001038.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/snapshot-only/00000000.db
vendored
Normal file
BIN
testdata/restore/snapshot-only/00000000.db
vendored
Normal file
Binary file not shown.
BIN
testdata/restore/snapshot-only/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/restore/snapshot-only/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
0
testdata/snapshot-time-bounds/no-snapshots/generations/0000000000000000/snapshots/.gitignore
vendored
Normal file
0
testdata/snapshot-time-bounds/no-snapshots/generations/0000000000000000/snapshots/.gitignore
vendored
Normal file
6
testdata/snapshot-time-bounds/ok/Makefile
vendored
Normal file
6
testdata/snapshot-time-bounds/ok/Makefile
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.PHONY: default
|
||||
default:
|
||||
TZ=UTC touch -t 200001010000 generations/0000000000000000/snapshots/00000000.snapshot.lz4
|
||||
TZ=UTC touch -t 200001020000 generations/0000000000000000/snapshots/00000001.snapshot.lz4
|
||||
TZ=UTC touch -t 200001030000 generations/0000000000000000/snapshots/00000002.snapshot.lz4
|
||||
|
||||
BIN
testdata/snapshot-time-bounds/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
BIN
testdata/snapshot-time-bounds/ok/generations/0000000000000000/snapshots/00000000.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/snapshot-time-bounds/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
BIN
testdata/snapshot-time-bounds/ok/generations/0000000000000000/snapshots/00000001.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/snapshot-time-bounds/ok/generations/0000000000000000/snapshots/00000002.snapshot.lz4
vendored
Normal file
BIN
testdata/snapshot-time-bounds/ok/generations/0000000000000000/snapshots/00000002.snapshot.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/err-download-wal/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/err-download-wal/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
testdata/wal-downloader/err-write-wal/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/err-write-wal/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
testdata/wal-downloader/missing-offset/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/missing-offset/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/missing-offset/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/missing-offset/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/00000000.wal
vendored
Normal file
BIN
testdata/wal-downloader/ok/00000000.wal
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/00000001.wal
vendored
Normal file
BIN
testdata/wal-downloader/ok/00000001.wal
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/00000002.wal
vendored
Normal file
BIN
testdata/wal-downloader/ok/00000002.wal
vendored
Normal file
Binary file not shown.
40
testdata/wal-downloader/ok/README
vendored
Normal file
40
testdata/wal-downloader/ok/README
vendored
Normal file
@@ -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
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000000/00002050.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000000/00002050.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000001/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000002/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000002/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000002/00001038.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/ok/generations/0000000000000000/wal/00000002/00001038.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/one/00000000.wal
vendored
Normal file
BIN
testdata/wal-downloader/one/00000000.wal
vendored
Normal file
Binary file not shown.
17
testdata/wal-downloader/one/README
vendored
Normal file
17
testdata/wal-downloader/one/README
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
|
||||
|
||||
Finally, remove the original database files:
|
||||
|
||||
rm db*
|
||||
|
||||
BIN
testdata/wal-downloader/one/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/one/generations/0000000000000000/wal/00000000/00000000.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/one/generations/0000000000000000/wal/00000000/00002050.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/one/generations/0000000000000000/wal/00000000/00002050.wal.lz4
vendored
Normal file
Binary file not shown.
BIN
testdata/wal-downloader/one/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
BIN
testdata/wal-downloader/one/generations/0000000000000000/wal/00000000/00003068.wal.lz4
vendored
Normal file
Binary file not shown.
0
testdata/wal-time-bounds/no-wal-segments/generations/0000000000000000/wal/.gitignore
vendored
Normal file
0
testdata/wal-time-bounds/no-wal-segments/generations/0000000000000000/wal/.gitignore
vendored
Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user