Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function fetch-wal-log(){
if [[ ! $wal_name =~ ^[0-9A-F]{24}$ && ! $wal_name =~ ^[0-9A-F]{8}\.history$ ]]; then
continue
fi
if [[ $wal_name < $start_wal_name ]]; then
if [[ ! $wal_name =~ \.history$ && $wal_name < $start_wal_name ]]; then
continue
fi
if [[ $pitr != "true" && $file =~ ".history" ]]; then
Expand Down
10 changes: 10 additions & 0 deletions addons/postgresql/scripts-ut-spec/pitr_restore_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,16 @@ EOF
The path "${tmpdir}/dest/00000002.history" should be exist
End

It "fetches current timeline history even when it sorts below the start WAL"
export DATASAFED_LIST_ROOT="20260816/"
export DATASAFED_LIST_DIR="00000002.history.zst
000000020000000000000001.zst"
When call fetch-wal-log "${tmpdir}/dest" "000000020000000000000001" "2026-01-01 00:00:00" true
The status should eq 0
The path "${tmpdir}/dest/00000002.history" should be exist
The result of function call_log should include "datasafed pull -d zstd 00000002.history.zst"
End

It "stops at the first WAL pull failure instead of crossing an archive gap"
export DATASAFED_LIST_ROOT="20260816/"
export DATASAFED_LIST_DIR="000000010000000000000002.zst
Expand Down
Loading