Skip to content

Merge 8.4 branch to trunk - #1738

Merged
satya-bodapati merged 6 commits into
percona:trunkfrom
satya-bodapati:trunk
Apr 17, 2026
Merged

Merge 8.4 branch to trunk#1738
satya-bodapati merged 6 commits into
percona:trunkfrom
satya-bodapati:trunk

Conversation

@satya-bodapati

Copy link
Copy Markdown
Contributor

No description provided.

PXB-3643 [8.0] : Improve xbcloud delete to support Hierarchical Namespaces
PXB-3643 [8.4] : Improve xbcloud delete to support Hierarchical Namespaces
… prepare

JIRA: https://perconadev.atlassian.net/browse/PXB-3328

After xtrabackup --prepare completes redo apply, there is no built-in
way to verify that the B-tree indexes are structurally correct. Users
must restore and run CHECK TABLE on a live server to find corruption.

This patch adds --check-tables to xtrabackup --prepare which validates
every committed InnoDB index after recovery. The option is only valid
during the prepare phase; it is rejected with --backup, --copy-back,
--move-back, and other non-prepare modes. It can be combined with
--export to validate indexes and produce export artifacts in a single
prepare invocation. It works with both --apply-log-only and final
prepare since validation is strictly read-only (SX-latch, no writes to
pages or dynamic metadata).

The implementation has five parts:

1. Dictionary loading: For each tablespace (file-per-table and general),
   load dict_table_t objects via dict_load_from_spaces_sdi(), similar to
   what --export already does.

2. Parallel B-tree validation: Spawn --parallel worker threads that call
   btr_validate_index() on every committed index. All corruptions are
   reported (no fail-fast). Per-index and per-table names are printed.

3. Graceful assertion handling: InnoDB's btr_validate_level() has 11
   ut_a() assertions that crash on corrupted pages. Under
   #ifdef XTRABACKUP these are converted to soft errors that log a
   message and return false. Corrupted sibling links (e.g. all-zero
   pages with FIL_PAGE_NEXT=0) are handled by stopping traversal to
   prevent infinite loops.

4. LOB corruption detection (PS-9683): Port of Percona Server fix to
   detect external LOB pages shared between two records, a corruption
   scenario found in production. Uses blob_ref_map to track LOB first
   pages through the validation call chain.

5. Test coverage: Two test scripts covering real-world corruption
   scenarios (PAGE_INDEX_ID corruption, checksum corruption, all-zero
   pages, multiple corrupted tables), invalid option combinations
   (--backup --check-tables, --copy-back --check-tables), --export
   combined with --check-tables, and debug-only injection tests
   (broken sibling links, wrong index ID, wrong min-record flag, LOB
   duplicates).
…k-table-prepare

PXB-3328 [8.4] : Add --check-tables option to validate InnoDB indexes during prepare
@satya-bodapati satya-bodapati self-assigned this Apr 17, 2026
@satya-bodapati
satya-bodapati merged commit 84a2dfa into percona:trunk Apr 17, 2026
3 checks passed
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.

1 participant