Skip to content

Commit

Permalink
Fix error taking a backup using PXB 8.0.35
Browse files Browse the repository at this point in the history
Latest versions of PXB support only one type of stream and
it should be specified using `=`. This fix makes it work for both 8.0.30
and recent versions.

Also decreased expected value of bytes read in the test for the backup,
it seems the default compression algorithm produces smaller file.

Fixed counting of restored files: qpress files are not supported
anymore. Default files use zstd format and end with .ztd.xbcrypt.
  • Loading branch information
alexole committed May 14, 2024
1 parent ac4a17e commit 9136bf9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ jobs:
percona-version: "8.0.32-26-1.focal"
python-version: "3.11"
ubuntu-version: "20.04"
- mysql-version: "8.0.35"
percona-version: "8.0.35-30-1.focal"
python-version: "3.11"
ubuntu-version: "20.04"

steps:
- id: checkout-code
Expand Down
3 changes: 1 addition & 2 deletions myhoard/basebackup_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ def create_backup(self):
encryption_key_file.name,
"--no-version-check",
f"--parallel={self.copy_threads}",
"--stream",
"xbstream",
"--stream=xbstream",
"--target-dir",
self.temp_dir,
"--extra-lsndir",
Expand Down
2 changes: 1 addition & 1 deletion myhoard/basebackup_restore_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def _process_xbstream_output_line(self, line: str, _stream_name: str) -> None:
self.log.info("xbstream: %r", line)

def _process_xbstream_output_line_new_file(self, line):
if not line.endswith(".qp.xbcrypt"):
if not line.endswith(".xbcrypt"):
return False

self.current_file = line
Expand Down
4 changes: 2 additions & 2 deletions test/test_basebackup_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def stream_handler(stream):
assert op.binlog_info["file_name"] == master_status["File"]
assert op.binlog_info["file_position"] == master_status["Position"]

# Even almost empty backup is a few megs due to standard files that are always included
assert bytes_read[0] > 2 * 1024 * 1024
# Even almost empty backup is at least 1.5 megs due to standard files that are always included
assert bytes_read[0] > 1.5 * 1024 * 1024


def test_stream_handler_error_is_propagated(mysql_master):
Expand Down

0 comments on commit 9136bf9

Please sign in to comment.