Support for --sync-safekeepers in tests (#647)

New command has been added to append specially crafted records in safekeeper WAL. This command takes json for append, encodes LogicalMessage based on json fields, and processes new AppendRequest to append and commit WAL in safekeeper.

Python test starts up walkeepers and creates config for walproposer, then appends WAL and checks --sync-safekeepers works without errors. This test is simplest one, more useful test cases (like in #545) for different setups will be added soon.
This commit is contained in:
Arthur Petukhovsky
2021-09-24 13:19:59 +03:00
committed by GitHub
parent 139936197a
commit d4e037f1e7
9 changed files with 366 additions and 10 deletions

View File

@@ -62,3 +62,7 @@ def debug_print(*args, **kwargs) -> None:
"""
if os.environ.get('TEST_DEBUG_PRINT') is not None:
print(*args, **kwargs)
def lsn_to_hex(num: int) -> str:
""" Convert lsn from int to standard hex notation. """
return "{:X}/{:X}".format(num >> 32, num & 0xffffffff)