Skip to content

Replace MinIO with SeaweedFS in xbstream_fifo_test.sh, fix keyring_file bugs - #11

Merged
saikumar-vs merged 1 commit into
mainfrom
pxb-seaweedfs-migration
Sep 22, 2026
Merged

saikumar-vs merged 1 commit into
mainfrom
pxb-seaweedfs-migration

Conversation

@saikumar-vs

@saikumar-vs saikumar-vs commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Swap start_minio() for start_seaweedfs() in xbstream_fifo_test.sh: runs SeaweedFS's S3 gateway via docker (chrislusf/seaweedfs), publishing container port 8333 as host 9000 so every existing xbcloud --s3-endpoint=http://localhost:9000 call is unchanged. Generates an S3 identity config so the admin/password credentials xbcloud already uses keep working. Readiness check polls the S3 port directly since SeaweedFS has no MinIO-style /minio/health/ready endpoint. cleanup_exit() now stops the seaweedfs container on script exit (success, error, or interrupt).
  • Restore test_scripts/pxb/kmip_helper.sh (it existed under test_scripts/pxb/old/ but was never re-pathed back after a prior file reorg), which init_datadir() sources for the keyring_kmip scenarios.
  • Fix full_backup_and_restore(): $COMPRESS_OPTIONS was set by the compressed-backup scenario but never actually passed to xtrabackup --backup, so compression never happened.
  • Fix init_datadir(): component_keyring_file.cnf used the wrong JSON key (component_keyring_file_data instead of path), so the keyring component silently failed to initialize.
  • Fix incremental_backup_and_restore(): the xtrabackup --backup calls never passed keyring config, so encrypted backups failed to init the keyring component during backup (--prepare already passed it correctly).

Test plan

  • Full backup/restore over SeaweedFS (Test 1) — verified against real PXB 8.4.0-7 / PS 8.4.10-10 builds
  • Incremental backup (full + 3 incrementals) over SeaweedFS (Test 2) — verified
  • Compressed backup over SeaweedFS, with the $COMPRESS_OPTIONS fix (Test 3) — verified, confirmed real zstd compression in logs
  • Partition-table backup via pstress over SeaweedFS (Test 4) — verified in isolation (the first attempt, chained after Tests 1-3, hit a FIFO race under very high cumulative file count; did not reproduce on a fresh, isolated run)
  • cleanup_exit() stops the SeaweedFS container on exit — verified directly

…le bugs

- Swap start_minio() for start_seaweedfs(): runs SeaweedFS's S3 gateway via
  docker (chrislusf/seaweedfs), publishing container port 8333 as host 9000
  so all existing xbcloud --s3-endpoint=http://localhost:9000 calls are
  unchanged. Generates an S3 identity config so the admin/password creds
  xbcloud already uses keep working. Readiness check polls the S3 port
  directly since SeaweedFS has no MinIO-style /minio/health/ready endpoint.
  cleanup_exit() now stops the seaweedfs container on script exit.
- Restore test_scripts/pxb/kmip_helper.sh (present in test_scripts/pxb/old/
  but never re-pathed after a prior reorg), which init_datadir() sources
  for the keyring_kmip scenarios.
- Fix full_backup_and_restore(): $COMPRESS_OPTIONS was set by the
  compressed-backup scenario but never passed to xtrabackup --backup, so
  compression never actually happened.
- Fix init_datadir(): component_keyring_file.cnf used the wrong JSON key
  (component_keyring_file_data instead of path), so the keyring component
  silently failed to initialize.
- Fix incremental_backup_and_restore(): the xtrabackup --backup calls never
  passed keyring config, so encrypted backups failed to init the keyring
  component during backup (prepare already passed it correctly).

Verified full/incremental/compressed/partition-table backups against
SeaweedFS end to end. Encrypted (keyring_file) backup now gets past both
keyring bugs but hits an unrelated InnoDB assertion crash inside
xtrabackup itself (fil0fil.cc:10943) during incremental backup of an
encrypted tablespace - a separate PXB issue to track, not a script bug.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@saikumar-vs
saikumar-vs merged commit f4fe085 into main Sep 22, 2026
3 checks passed
saikumar-vs added a commit that referenced this pull request Sep 22, 2026
hashicorp was commented out of KMIP_CONFIGS/DEFAULT_KMIP_CONFIGS and, even
if enabled, KMIPHelper.setup_hashicorp() executed the downloaded
hashicorp_kmip_setup.py (a real Python script, #!/usr/bin/env python3,
argparse-based) via `bash -s`, which would have failed immediately with a
syntax error. Fixed to invoke it via `python3 -`, matching how the retired
bash kmip_helper.sh ran it.

Enabling hashicorp in the shared KMIP_CONFIGS adds a `[hashicorp]`
parametrized variant to every vault_type-parametrized test that reads from
it (test_fifo_kmip_backup here, plus the existing test_kmip_component_backup
and test_crash_backup_encrypted_kmip in inc_backup_load_tests.py). Added a
VAULT_LICENSE environment-variable guard (pytest.skip when unset) at each
of those three call sites, matching the existing FORTANIX_EMAIL/PASSWORD
guard pattern, since hashicorp_kmip_setup.py requires a real HashiCorp
Vault Enterprise license.

Verified: xbstream_fifo_tests.py::test_fifo_kmip_backup[hashicorp] skips
cleanly (no VAULT_LICENSE in this environment) instead of failing; full
license-driven setup path still needs a real Vault Enterprise license to
verify end-to-end, same limitation noted for the bash script in PR #11.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
saikumar-vs added a commit that referenced this pull request Sep 22, 2026
Adds FIFO-streamed cloud backup coverage to the Python test framework,
following the conventions of innodb_myrocks_backup_tests.py and
inc_backup_load_tests.py:

- test_helper.py: additive FIFO_STREAM/FIFO_DIR constants and six new
  BackupTestHelper methods (take_fifo_backup_step, restore_fifo_backup_step,
  take_fifo_full_backup_and_restore, take_fifo_incremental_backup_and_restore,
  restore_datadir_from, cleanup_fifo_state). These stream xtrabackup/xbstream
  and xbcloud through named pipes as two concurrent processes (background +
  foreground), mirroring the bash script's xbcloud_put()/xbcloud_get(),
  rather than take_backup()'s "cloud" backup_type (a single shell pipe).
  No existing method was modified.
- seaweedfs_helper.py: new SeaweedFSHelper class managing the local
  SeaweedFS S3-gateway docker container, ported from the already-fixed
  xbstream_fifo_test.sh start_seaweedfs()/cleanup_exit() shell logic
  (percona-qa/server-qa PR #11).
- xbstream_fifo_tests.py: the actual test file, with a session-scoped
  seaweedfs fixture and 7 tests mirroring the bash script's scenarios
  (full, incremental, compressed, partition-table, keyring_file, keyring_kmip,
  xbcrypt-encrypted backup).
- README.md: new section documenting env vars, how to run, and the test
  reference table, matching the existing per-file structure.

Verified end-to-end against real PXB 8.4.0-7 / PS 8.4.10-10 builds and a
live SeaweedFS container: all 7 tests pass (test_fifo_kmip_backup requires
KMIP vault/license resources not available in this environment, so it
wasn't run, matching the same gap noted in the bash-script PR). One
transient SeaweedFS-readiness timeout and one missing --xtrabackup-plugin-dir
in two tests' prepare_params were found and fixed during that verification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
saikumar-vs added a commit that referenced this pull request Sep 22, 2026
hashicorp was commented out of KMIP_CONFIGS/DEFAULT_KMIP_CONFIGS and, even
if enabled, KMIPHelper.setup_hashicorp() executed the downloaded
hashicorp_kmip_setup.py (a real Python script, #!/usr/bin/env python3,
argparse-based) via `bash -s`, which would have failed immediately with a
syntax error. Fixed to invoke it via `python3 -`, matching how the retired
bash kmip_helper.sh ran it.

Enabling hashicorp in the shared KMIP_CONFIGS adds a `[hashicorp]`
parametrized variant to every vault_type-parametrized test that reads from
it (test_fifo_kmip_backup here, plus the existing test_kmip_component_backup
and test_crash_backup_encrypted_kmip in inc_backup_load_tests.py). Added a
VAULT_LICENSE environment-variable guard (pytest.skip when unset) at each
of those three call sites, matching the existing FORTANIX_EMAIL/PASSWORD
guard pattern, since hashicorp_kmip_setup.py requires a real HashiCorp
Vault Enterprise license.

Verified: xbstream_fifo_tests.py::test_fifo_kmip_backup[hashicorp] skips
cleanly (no VAULT_LICENSE in this environment) instead of failing; full
license-driven setup path still needs a real Vault Enterprise license to
verify end-to-end, same limitation noted for the bash script in PR #11.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants