99 Commits
Author SHA1 Message Date
Yura Sokolov 63c281066d fix restoring highly compressed WAL
gzip surprisingly emits a lot of zeroes when compression ratio is high.
It triggered branch where FIO_PAGE_ZERO is emitted in agent but not handled
in fio_sned_file_gz properly.

Fix it.
2024-03-14 17:53:31 +03:00
Yura SokolovandOleg Gurev 343ed029a4 test_recovery_target_lsn_backup_victim - looks like it should pass
and not fail
2023-12-27 11:39:10 +03:00
Yura Sokolov de531e62e4 PBCKP-797: fix race condition by waiting
and filling same amount of rows.
2023-11-13 15:26:23 +03:00
Yura Sokolov 70b97d8516 declare XID_FMT for PGPRO_EE if not defined 2023-11-13 15:23:07 +03:00
Yura Sokolov d6721662ec Use _chsize_s on windows to grow file
Looks like "seek after file end and write" doesn't work
correctly in Windows. We have to grow file before.

Met occasionally on GitHub actions run. Could not reproduce
locally.
2023-04-18 21:48:05 +03:00
Yura Sokolov b7551bd2bf PBCKP-91: delete "\r" in windows command output. 2023-04-18 21:25:30 +03:00
Yura Sokolov 279c98140f PGPRO-552: use uint32 in some places 2023-04-15 14:48:17 +03:00
Yura SokolovandSergey Fukanchik 3c111262af compatibility tests: skip if PGPROBACKUPBIN_OLD is not set 2023-03-07 18:23:48 +03:00
Yura Sokolov cbf2bf9dde Merge remote-tracking branch 'origin/REL_2_5' into REL_2_5 2023-02-28 22:58:09 +03:00
Yura Sokolov 297dd2a7eb test for previous commit 2023-02-10 15:07:25 +03:00
Yura Sokolov c8909b825e Fix warning in get_backup_filelist
pg_multixact contains files which looks like db files,
but they are not.

get_backup_filelist should not pass to set_forkname files
not in db folder nor `global` folder.
2023-02-09 15:33:10 +03:00
Yura Sokolov 92a4d56cd5 Merge remote-tracking branch 'origin/REL_2_5' into REL_2_5 2023-01-20 04:08:41 +03:00
Yura Sokolov 1f5991dadb fix cfs handling: forgot to set skip_cfs_nested 2023-01-20 04:06:41 +03:00
Yura Sokolov 137814aa6f do_retention_merge: fix removing from to_keep_list 2023-01-19 13:45:34 +03:00
Yura Sokolov 610216c6f8 ptrack_helpers.py: fix compare_pgdata 2023-01-13 15:31:12 +03:00
Yura Sokolov b240b90772 fix for < Pg12 2023-01-13 09:38:48 +03:00
Yura Sokolov d3babee2ae [PBCKP-287] simplify and fix cfs chaining
- properly chain only main fork and cfs related forks
- properly chain datafile with its cfm even sort order places other
  segments between
- don't raise error for system tables which has no companion cfm.

+ fix couple of tests
2023-01-12 17:30:54 +03:00
Yura Sokolov 343c6a0f98 [PBCKP-423] add '.partial.part' detection as well
Purposes are:
- to not issue WARNING
- to remove file properly in delete_walfiles_in_tli
2023-01-12 00:26:45 +03:00
Yura Sokolov fa2902090a [PBCKP-423] and backport cleanup_ptrack for test_archive_push_sanity 2023-01-12 00:04:47 +03:00
Yura Sokolov 22bdbb3915 [PBCKP-423] test_archive_push_sanity: wait logs with tail_file
(and some other test as well).
2023-01-11 23:37:45 +03:00
Yura Sokolov 8f4e7d6e5f [PBCKP-346] archive-get doesn't need -D/--pgdata argument at all 2022-12-22 06:05:51 +03:00
Yura Sokolov 764680e23f Merge branch 'REL_2_5' 2022-12-15 22:47:46 +03:00
Yura Sokolov 10ac3c9918 [PBCKP-402] bound check for abortedRecPtr to Pg15
It is not really needed in previous versions.
It doesn't harm, but we want to reduce tests amount.
2022-12-13 13:09:34 +03:00
Yura Sokolov 24f12d98d9 [PBCKP-402,PBCKP-354] refix "missing contrecord" detection.
Error message is translated according to current locale. So we can't
compare it as a string. But `abortedRecPtr` exists exactly for this case,
so we can rely on it.
2022-12-13 02:52:18 +03:00
Yura Sokolov 25e63c5a7c raw strings in python regex; ignore generated transation files
Author: Sergey Fukanchik
2022-12-08 07:44:12 +03:00
Yura Sokolov 29a9efb4d4 [PBCKP-325] refix test_issue_231
to make two backups in one second we have to fail them.
Therefore we have to fetch backup_id from log in exception's message.

Retry for 20 seconds to have a chance to start in one second.
If we couldn't, lets skip the test.
2022-12-06 14:17:04 +03:00
Yura Sokolov bef73b8ba6 more usages for table_checksum 2022-12-06 01:59:14 +03:00
Yura Sokolov 6bd71d866d [PBCKP-382] and another one Pg15 pg_backup_stop() 2022-12-06 01:51:22 +03:00
Yura Sokolov 3109634ecb [PBCKP-325] change test_issue_231 to check backup id are different 2022-12-05 15:49:12 +03:00
Yura Sokolov 0f7e01b7f3 try travis without docker 2022-12-04 14:16:02 +03:00
Yura Sokolov f2f47f7734 get rid of plpython usage 2022-12-04 05:33:52 +03:00
Yura Sokolov fc50cf0ddf tests: fix
travis uses old image with python3.5
2022-12-04 04:24:55 +03:00
Yura Sokolov 02e3fb0477 tests: table_checksum needs no sorting in fact
since we are compare table content exactly
2022-12-04 04:15:55 +03:00
Yura Sokolov 8d8a92c1d1 tests: more usages for table_checksum
and reduce batch twice for sanity
2022-12-02 16:56:54 +03:00
Yura Sokolov 9bcefb2569 [PBCKP-327] test_ptrack_multiple_segments: try to avoid memory consumption 2022-12-02 15:10:22 +03:00
Yura Sokolov 619816012a fix ArchiveTest.test_pgpro434_4 for Pg15 2022-11-30 21:50:20 +03:00
Yura Sokolov 8fa063f688 travis: and backup_test 2022-11-30 16:34:00 +03:00
Yura Sokolov 3b2efe63a2 and again try fix travis tests.init_test 2022-11-30 14:58:36 +03:00
Yura Sokolov e2dd78a99e Merge branch 'REL_2_5-PBCKP-360' into REL_2_5 2022-11-29 20:17:46 +03:00
Yura Sokolov 3b72dd66af fix github tests.init_test 2022-11-29 16:24:49 +03:00
Yura Sokolov 0a5fc87dbd [PBCKP-360] fix exception check in test_validate_corrupt_page_header_map
zlib decompression could mark error either as "data error" or
"buffer error". One of check did consider it, other didn't.

Make them same.

And use `assertRaises` for good (requires python 3.2 at least)
2022-11-29 15:13:34 +03:00
Yura Sokolov 887fb82a2c Merge branch 'master' into REL_2_5 2022-11-29 11:56:40 +03:00
Yura Sokolov 15a5c5dad7 [PBCKP-354] Pg15: continue reading if error "missing contrecord" is met.
Pg15 now reports if it didn't met expected contrecord. Absence of this
message was long standing bug in previous postgres versions.

This situation could happen if WAL segment was rewritten after restart.

It causes "tests.validate.ValidateTest.test_validate_wal_unreal_values"
to hang but (looks like) for other reason: test tries to read "in future".

Probably we should stop reading logs here. But since we always did
continue here, lets continue as well.
2022-11-29 11:12:20 +03:00
Yura Sokolov be949fd91e fix memory leak in config_get_opt 2022-11-25 16:23:56 +03:00
Yura Sokolov 440441dc6f ... fix names 2022-11-25 11:26:54 +03:00
Yura Sokolov 1617eb34ec tests: prettify pgdata_content and compare_pgdata 2022-11-25 11:03:52 +03:00
Yura Sokolov 20667e9594 tests: better directory collection in pgdata_content
There is no need to walk pgdata twice.
We could delete parent directories instead of skipping them.
2022-11-25 08:31:00 +03:00
Yura Sokolov 19a7c5b01f tests: do not read whole file at once for digest. Iterate instead. 2022-11-25 07:59:14 +03:00
Yura Sokolov 7eab6e3463 [PBCKP-358] sort directories to not skip 'base/1' because of 'base/12699'
Looks like os.walk may yield dirs unsorted.
This way "check if directory already here as part of larger directory"
man mistakenly skip short 'base/1' as "part of" 'base/12699'
2022-11-25 07:58:08 +03:00
Yura Sokolov b7a183081e [PBCKP-357] fix UnicodeDecodeError
Got in some tests:
```
Traceback (most recent call last):
  File "pg_probackup/tests/replica.py", line 625, in test_replica_stop_lsn_null_offset
    gdb_checkpointer = self.gdb_attach(bgwriter_pid)
  File "pg_probackup/tests/helpers/ptrack_helpers.py", line 1984, in gdb_attach
    return GDBobj([str(pid)], self, attach=True)
  File "pg_probackup/tests/helpers/ptrack_helpers.py", line 2054, in __init__
    line = self.get_line()
  File "pg_probackup/tests/helpers/ptrack_helpers.py", line 2065, in get_line
    line = self.proc.stdout.readline()
  File "/usr/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 189: invalid continuation byte
```
Fixed with `errors='replace'`
2022-11-25 06:40:07 +03:00
Yura Sokolov 73cce507c2 [PBCKP-358] fix CatchupTest.test_unclean_(delta|ptrack)_catchup
and BugTest.test_minrecpoint_on_replica as well

Tests were broken with introduction of "startness" handling in
    9924ab014 [PBCKP-304] extended testgres.PosgresNode to ...
since tests uses os.kill directly.
2022-11-25 04:20:29 +03:00
Yura Sokolov e674202eac test_backup_via_unprivileged_user - test with ptrack correctly 2022-11-24 14:42:12 +03:00
Yura Sokolov 8488b289ba fix test_backup_via_unprivileged_user with ptrack enabled
It is garbage remained from old ptrack version support.
2022-11-24 14:23:45 +03:00
Yura Sokolov 08557855e2 fix error
During refactoring base36enc it were mistakenly changed from
current_backup->start_time to current_backup->parent_backup
2022-11-24 12:30:25 +03:00
Yura Sokolov 87dd3f2021 base36enc(backup->backup_id) -> backup_id_of(backup)
Here we assume backup_id == start_time.
It is really so at the moment, but could change in future.

Well, it almost always same. Sometime backup_id is set
while start_time is not set yet (backup creation). And
we had to fix places where start_time were changed without
change of backup_id.
2022-11-23 20:51:20 +03:00
Yura Sokolov 44fef8894e a bit more backup_id_of 2022-11-23 17:50:51 +03:00
Yura Sokolov 71f8ccf4cd replace base36enc(backup->start_time) with helper backup_id_of(backup)
Lazily store encoded backup_id in backup itself.
2022-11-23 17:21:31 +03:00
Yura Sokolov 20e12edc80 fix one of backup_id output. 2022-11-23 17:21:31 +03:00
Yura Sokolov 22e6c408fe base36enc: abuse C99 compound literals lifetime.
C99 introduced compound literals (`(char[14]){0}` - literal of array).
Compound literals have same lifetime as block local variable, ie till
the end of block. There for it is save to initiate several of them in
same block and assume they are all live.

This way we may rewrite base36enc into macros which uses compound
literal instead of static variable to extend its result lifetime.
2022-11-23 17:21:31 +03:00
Yura Sokolov 97f3e70edb asyncio.sleep -> time.sleep 2022-11-17 12:55:15 +03:00
Yura Sokolov 4c823b3930 ... 2022-11-16 16:14:32 +03:00
Yura Sokolov 516d325a11 Merge branch 'REL_2_5' into REL_2_5-PBCKP-304 2022-11-16 16:12:10 +03:00
Yura Sokolov 858de550e8 Merge branch 'master' into REL_2_5 2022-11-16 16:02:48 +03:00
Yura Sokolov 8c670f0f9b move test_basic_full_backup => test_full_backup
run it in separate travis action
+ add same test with stream replication
2022-11-16 13:43:20 +03:00
Yura SokolovandIvan Lazarev e2b4549887 Merge branch 'REL_2_5' into REL_2_5-PBCKP-304 2022-11-15 17:35:22 +03:00
Yura Sokolov 5f66a60a81 Merge branch 'master' into REL_2_5 2022-11-15 15:03:55 +03:00
Yura Sokolov 348283b307 update version to 2.5.10 2022-11-15 13:43:09 +03:00
Yura Sokolov de411ed393 Merge branch 'REL_2_5_correct_test_skip' into REL_2_5 2022-11-15 13:03:45 +03:00
Yura Sokolov 457e06296c Merge branch 'REL_2_5' 2022-11-15 12:59:28 +03:00
Yura Sokolov b7bd831b8d correctly test skips 2022-11-15 11:32:15 +03:00
Yura Sokolov 4505def249 properly skip ptrack tests. 2022-11-15 11:27:06 +03:00
Yura Sokolov 4869a564d0 [PBCKP-336] Fix segno calculation.
It were lost during fork-name detection fix at eaf3b14c22 .
And since there were no basic test for this, it were not detected.
2022-11-14 13:04:09 +03:00
Yura Sokolov 04e05b151d Fix auth_test.py 2022-11-09 12:17:10 +03:00
Yura Sokolov b17669c969 [PBCKP-146] add test for "unchanged cfm is not backuped" 2022-11-03 11:51:40 +03:00
Yura Sokolov 7cadc3378c [PBCKP-146] fix filesize filling
file->size were not filled while reading backup filelist.
That lead to excess non-data file backups.
2022-11-03 11:51:40 +03:00
Yura Sokolov 693bffe08d [PBCKP-146] fix cfm truncated crc calculation in delta/page backup
- On backup we should compare truncated crc with previous version.
- copying remote file didn't honor "don't truncate first 64 bytes" rule.
- crc calculation didn't honoer "don't truncate first 64 bytes" rule.
2022-11-03 11:50:30 +03:00
Yura Sokolov 85708251bb fix for forkname detection in get_backup_filelist 2022-11-03 03:40:35 +03:00
Yura Sokolov a8ee334c3f [PBCKP-235] fix one test for <15.0 2022-11-03 03:40:35 +03:00
Yura Sokolov eaf3b14c22 fix set_forkname
Fork detection were broken before set_forkname extraction, and its bug
were copied into.

Lets reimplement it to be like `parse_filename_for_nonetemp_relation` in
PostgreSQL code.
2022-11-03 03:40:35 +03:00
Yura Sokolov 0c7c78b8e8 Merge branch 'REL_2_5-PBCKP-146-2' into REL_2_5 2022-11-02 22:32:09 +03:00
Yura Sokolov 34af0255cd Merge branch 'master' into REL_2_5 2022-11-02 17:24:03 +03:00
Yura Sokolov e36924a0fd [PBCKP-146] review fixes 2022-11-01 12:53:46 +03:00
Yura Sokolov f253798250 [PGPRO-146] cfs_catchup test
Test full catchup and delta catchup.
2022-10-24 21:57:55 +03:00
Yura Sokolov a20eb7bddb [PGPRO-146] pgdata_content: checksum for truncated cfm 2022-10-24 21:57:14 +03:00
Yura Sokolov 302db1c49f [PGPRO-146] store at least cfs header size bytes. 2022-10-24 20:35:29 +03:00
Yura Sokolov 5f71f7710f fix fio_send_file_local 2022-10-24 17:28:07 +03:00
Yura Sokolov 2eaeb942c6 [PBCKP-146] add test for cfm size 2022-10-24 17:16:19 +03:00
Yura Sokolov 202f2ade7f find_zero_tail: fix last bytes check 2022-10-24 17:16:14 +03:00
Yura Sokolov b568f2254a [PBCKP-146] truncate cfm files
- store cfm files truncated to non-zero head with coarse granularity
  (64-4096 bytes)
- and calculate crc for truncated file
- during restoration calculate crc for cfm as if it was truncated
2022-10-20 19:58:54 +03:00
Yura Sokolov ed47e4925d Merge branch 'REL_2_5-some-fixes' into REL_2_5 2022-10-13 16:32:22 +03:00
Yura Sokolov 51a141c4b0 [PBCKP-146] fix cfs test python3 compatibility 2022-10-13 14:27:40 +03:00
Yura Sokolov 8f504fc95c [PBCKP-146] stabilize couple of tests. 2022-10-13 14:27:40 +03:00
Yura Sokolov e16c62e8fd [PBCKP-146] prettify forkname handling. 2022-10-13 14:27:40 +03:00
Yura Sokolov 4730857b79 [PBCKP-146] - fio_get_crc32 - add "missing_ok" parameter 2022-10-13 14:27:40 +03:00
Yura Sokolov 80efb85029 [PBCKP-146] Small fix for remote_agent 2022-10-13 14:27:40 +03:00
Yura Sokolov 3071cec4f6 fix ArchiveTest.test_pgpro434_4 2022-07-11 14:50:22 +03:00
Sokolov YuraandGitHub e72feb6813 rapid agent close + disable ssh control master. (#493) 2022-06-16 09:26:02 +03:00
Yura Sokolov d3bbb74d01 tests: disable autovacuum by default
With autovacuum enabled tests are unstable. Especially they are unstable
if postgresql is running under valgrind and therefore is severely
inhibited (and vacuum has time to be triggered).
2021-05-25 17:09:42 +03:00
Yura Sokolov 012719d286 fix valgrind alerts
valgrind detected some uninitialized memory usage.
Looks like shift_lsn one is a real bug.
2021-05-24 21:27:13 +03:00