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 @@ -70,6 +70,10 @@ function fetch-wal-log(){
return 1
fi

if [[ $wal_name =~ \.history$ ]]; then
continue
fi

# check if the wal_log contains the restore_time logs. if ture, stop fetching
if ! wal_dump=$(pg_waldump "${wal_destination_dir}/${wal_name}" --rmgr=Transaction 2>/dev/null); then
DP_error_log "failed to inspect WAL ${wal_name}"
Expand Down
11 changes: 11 additions & 0 deletions addons/postgresql/scripts-ut-spec/pitr_restore_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@ EOF
The result of function call_log should not include "datasafed pull -d zstd 000000010000000000000001metadata.zst"
End

It "pulls timeline history without inspecting it as a WAL segment"
export DATASAFED_LIST_ROOT="20260816/"
export DATASAFED_LIST_DIR="000000010000000000000002.zst
00000002.history.zst"
export PG_WALDUMP_FAIL_OBJECT="00000002.history"
When call fetch-wal-log "${tmpdir}/dest" "000000010000000000000001" "2026-01-01 00:00:00" true
The status should eq 0
The output should not include "failed to inspect WAL 00000002.history"
The path "${tmpdir}/dest/00000002.history" should be exist
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