1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2026-06-21 01:34:15 +02:00
Commit Graph

3931 Commits

Author SHA1 Message Date
Yura Sokolov 649d1adc27 [PBCKP-431] refix test_minrecpoint_on_replica
in fact there were too many wal_keep_segments set by default in
make_simple_node
2022-12-29 05:37:39 +03:00
Yura Sokolov 361b9a7b51 fix for XLogReader's read_page callback contract 2022-12-29 04:13:36 +03:00
Yura Sokolov 3dd5219e13 try to fix test_minrecpoint_on_replica for Pg<=12 2022-12-29 04:12:45 +03:00
Yura Sokolov 428d10ddc6 pioDirNext: skip just deleted file 2022-12-29 03:26:49 +03:00
Yura Sokolov 0edd95862f s/test_needs_gdb/need_gdb/
fixtures plugin fails to fill 'func' fixture for 'test_needs_gdb' :-(
2022-12-29 01:37:24 +03:00
Yura Sokolov 7b587f75f0 [PBCKP-423] and again 2022-12-28 13:44:16 +03:00
Yura Sokolov cf10582d6a [PBCKP-423] remove redundant ptrack warning 2022-12-28 13:30:04 +03:00
Yura Sokolov b2cf9afb0d @test_needs_gdb
- make function decorator
- check for decorator in GDBObj
- check for linux's ptrace
2022-12-28 12:31:28 +03:00
Yura Sokolov f38ac06872 reset timeouts in test_archive_replica_not_null_offset 2022-12-28 09:54:53 +03:00
Yura Sokolov 77fc12ac87 gdb kill did quit 2022-12-27 14:50:31 +03:00
Yura Sokolov f8b480e7c6 try to fix test_archive_get_batching_sanity 2022-12-27 14:44:41 +03:00
Yura Sokolov f5c0980d1c try to fix test_archive_replica_null_offset 2022-12-27 13:32:45 +03:00
Yura Sokolov cb19d6a24b fix replica_tests stop_lsn_null_offset 2022-12-27 13:19:25 +03:00
Yura Sokolov 03e5dce768 fix pioLocalReadFile_pioRead 2022-12-27 08:56:35 +03:00
Yura Sokolov dab39571f2 copy-paste some test fixes
authors: Victoria Shepard and Sergey Fukanchik
2022-12-26 13:27:33 +03:00
Yura Sokolov 0cf3d050f6 [PBCKP-434] make stop_backup_lsn volatile.
Well, it is not really enough. We must use atomic. Lets do it later.
2022-12-26 12:28:17 +03:00
Yura Sokolov ed609d8a3c again test_backup_with_less_privileges_role
Try to delay switch_wal_segment to stabilize
2022-12-26 12:25:03 +03:00
Yura Sokolov ecf0a7de40 [PBCKP-434] prefer to RunXLogThreads with consistent_read=true
I doubt 'false' is ever usable.
2022-12-26 11:59:41 +03:00
Yura Sokolov bed69c3ba4 [PBCKP-434] fix replica_test.py
There are a lot less messages to check for.
And in fact backup in test_archive_replica_not_null_offset starts to
succeed.
2022-12-26 11:59:41 +03:00
Yura Sokolov bc0ea49df6 [PBCKP-434] stabilize backup_test
there was some nose-to-nose timing, so it could sporadically fail.
And in fact timeouts need no to be so large. Reduce them a bit.
2022-12-26 11:59:41 +03:00
Yura Sokolov 8952b84b83 [PBCKP-434] greatly simplify stop_lsn handling
It was long believed `stop_lsn` should point on start of last record.
But in fact it points to end of last record (because XLogInsert(BACKUP_END)
returns pointer to end of record, and that is what pg_backup_stop/
pg_stop_backup returns).

So we don't need to lookup `stop_lsn` record in WAL log, but rather check
existence of record which ends on `stop_lsn` (which is what
`get_prior_record_lsn` does).

And there is no need to raise error on `stop_lsn` which points on block end
- it is very valid when xlog record ends at block end.

So:
- we simplify wait_wal_lsn to just wait for `get_prior_record_lsn` returns
  "ok" (ie find such previous record). But now we don't overwrite stop_lsn
  with lsn of this record.
- we use `wait_wal_lsn` only in "ARCHIVE" mode/directory.
  So get rid of `in_stream_dir` argument.
- and `wait_wal_lsn` now waits only for previous record even for
  `is_start_lsn`, since there is no much gain in waiting for it.
  Even for PAGE mode we need only records before `start_lsn`, since
  `start_lsn` record is considered as part of backup.
- "STREAM" mode now waits for lsn by hooking streamer. We don't need to
  calculate stop_backup_lsn since we may use stop_backup_result.lsn
  directly to stop streamer.
  After streamer stopped, we just check wal with `get_prior_record_lsn`. We
  don't need to, but just for sanity.
- therefore `wait_wal_and_calculate_stop_lsn` become obsolete. Lets get rid
  of it.
  Without it, there is no need in get_first_record_lsn and
  get_next_record_lsn. Lets delete them too.
- Instead of using XRecOffIsValid and XRecOffIsNull use added
  XRecPtrLooksGood and XRecEndLooksGood.
  XRecPtrLooksGood validates record start more rigidly than XRecOffIsValid,
  and XRecEndLooksGood validates record end, which could be on block end.
- In fact, some of `XRecOffIsValid(x)` had to be `!XLogRecPtrIsInvalid(x)`
- Since stop_lsn is not inclusive now, RunXLogThreads doesn't need
  `inclusive_endpoint` parameter.
  (And because Page mode needs just till start_lsn)
- PAGE_LSN_FROM_FUTURE must be considered as error, btw.

(And by the way there's no need to XLogBeginRead before XLogFindNextRecord.
 Cleanup such calls)
2022-12-26 11:59:41 +03:00
Yura Sokolov 79b8755b62 fix test_checkdb_checkunique 2022-12-26 11:59:03 +03:00
Yura Sokolov dc9cfb86b3 fix pioRemoteDrive_pioOpenRewrite 2022-12-25 19:24:59 +03:00
Yura Sokolov b0182bd5ed fix test_pgpro560_control_file_loss 2022-12-25 03:57:51 +03:00
Yura Sokolov 6a9850be62 fix test_options_5 2022-12-25 03:52:01 +03:00
Yura Sokolov 21c811c87a [PBCKP-365] jentlier 2022-12-25 03:50:25 +03:00
Victor Spirin a65902c2e0 [PBCKP-365] Fixed test help_6 test. Added check_locale function for check that locale is installed. 2022-12-24 14:50:14 +03:00
Yura Sokolov ffc8566097 [PBCKP-428] read_recovery_info don't need XRecOffIsValid(stop_lsn)
since it uses XLogFindNextRecord, it could use stop_lsn with no valid
offset. In fact, it uses truncated stop_lsn with invalid offset always.

Also fix getting timestamp from possible record in a future.
We could not to not enter the loop since we need record->xl_prev to
correctly walk backward. So we need to add condition before
getRecordTimestamp.
2022-12-24 04:57:10 +03:00
Yura Sokolov 12b8bfbc4c try to speedup test_replica_archive_page_backup 2022-12-24 04:45:02 +03:00
Yura Sokolov 4ddf8a1dfe speedup test_archive_replica_not_null_offset 2022-12-24 04:06:23 +03:00
Yura Sokolov cfcba44f97 [PBCKP-330] fix test_archive_replica_not_null_offset
postgrespro enterprise has dirrerent xlog record size due to 64bit xid.
ee15 changed this size again.
2022-12-24 03:23:55 +03:00
Yura Sokolov b70d76ec4a fix warning 2022-12-23 17:25:17 +03:00
Yura Sokolov c3430a685f [PBCKP-270] fetch current log position directly from streamer.
We have streamer in our hand, so we may ask it directly, what are it
streaming now.

But in case we looks into previous segment, we fallback to log reading
since it is already flushed.
2022-12-23 17:11:37 +03:00
Yura Sokolov 3e75df6db5 [PBCKP-270] fixes 2022-12-23 16:24:32 +03:00
Victor Spirin 71e6895935 [PBCKP-270] Updated wait_wal_lsn function for begin backup without wal file for streaming WAL. 2022-12-23 13:34:06 +03:00
Victor Spirin 8b46c8af63 [PBCKP-270] Fixed some functions for WAL stream 2022-12-23 13:34:06 +03:00
Victor Spirin 2904405a5f [PBCKP-270] Added pio file functions for compatibility/walmethods.c 2022-12-23 13:34:06 +03:00
Yura Sokolov 4418ec9572 [PBCKP-428] fix "optimize read_recovery_info"
Well, we couldn't easily step back be 1MB, since it could be in
uninitialized tail of previous segment.

We need to use valid pointer in record->xl_prev.
2022-12-23 12:31:43 +03:00
Yura Sokolov fe82f4e45e test_recovery_target_lsn_backup_victim - looks like it should pass
and not fail
2022-12-23 09:20:42 +03:00
Yura Sokolov c83d69c359 fix test_continue_failed_merge_2 2022-12-23 09:00:51 +03:00
Yura Sokolov f9615aeb6b fix test_merge_external_dir_is_missing 2022-12-23 08:47:56 +03:00
Yura Sokolov d8c41ae1eb fix init tests 2022-12-23 08:41:53 +03:00
Yura Sokolov a394ea3a5d fix test_missing_replication_permission_1 : fix freing xlogFile
xlogFile did contain pgFile in its start. Therefore pgFileFree were used
to free it.

Not xlogFile doesn't contain pgFile, so its free procedure should be fixed.
2022-12-23 08:18:02 +03:00
Yura Sokolov eecba5f4aa fix test_remove_instance_config 2022-12-23 08:04:50 +03:00
Yura Sokolov 46517a2fa0 fix test_backup_concurrent_drop_table 2022-12-23 07:59:15 +03:00
Yura Sokolov 80caef108b fix auth_test.test_backup_via_unprivileged_user 2022-12-23 07:47:22 +03:00
Yura Sokolov cc82beecd1 [PBCKP-428] optimize read_recovery_info
Instead of stepping back by one record, step back by megabyte and then go
forward. This is much better both for gzipped wal and for S3.
2022-12-23 07:46:49 +03:00
Yura Sokolov 6b8d3df368 [PBCKP-427] cache header map files 2022-12-23 06:49:03 +03:00
Yura Sokolov 7eed384934 [PBCKP-427] introduce pgFile hashtable
We want to sort files be offset in page header map file.
But it breaks searching with binary search by filename.
Therefore make and use hashtable instead of binary search.
2022-12-23 06:48:16 +03:00
Yura Sokolov c675380503 backup: descending sort by file size
it is better suited for load balancing among threads
2022-12-23 03:24:43 +03:00