Skip to content

PXB-3662: Clarify --tables and --databases conflict in docs#452

Open
satya-bodapati wants to merge 2 commits intopercona:8.0from
satya-bodapati:8.0
Open

PXB-3662: Clarify --tables and --databases conflict in docs#452
satya-bodapati wants to merge 2 commits intopercona:8.0from
satya-bodapati:8.0

Conversation

@satya-bodapati
Copy link
Collaborator

https://perconadev.atlassian.net/browse/PXB-3662

The --tables and --databases options in XtraBackup have complex interactions when used together, often leading to unexpected results such as skipping databases entirely or including all tables despite a regex filter.

This commit updates the documentation to:

  • Clarify that --databases acts as a high-level filter that precedes table-level checks, which can override --tables regex patterns.
  • Add a new "Filtering Behavior with Examples" section in docs/create-partial-backup.md to demonstrate why mixing these options fails.
  • Provide a solution for combining specific tables with full databases using --tables-file alongside --databases.
  • Update the "Mutual exclusion" warnings in docs/xtrabackup-option-reference.md to accurately describe the conflict and interaction between these parameters.

https://perconadev.atlassian.net/browse/PXB-3662

The --tables and --databases options in XtraBackup have complex interactions when used together, often leading to unexpected results such as skipping databases entirely or including all tables despite a regex filter.

This commit updates the documentation to:
- Clarify that `--databases` acts as a high-level filter that precedes table-level checks, which can override `--tables` regex patterns.
- Add a new "Filtering Behavior with Examples" section in `docs/create-partial-backup.md` to demonstrate why mixing these options fails.
- Provide a solution for combining specific tables with full databases using `--tables-file` alongside `--databases`.
- Update the "Mutual exclusion" warnings in `docs/xtrabackup-option-reference.md` to accurately describe the conflict and interaction between these parameters.
@patrickbirch patrickbirch self-requested a review February 3, 2026 09:35
Copy link
Collaborator

@patrickbirch patrickbirch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COmments in slack

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use Latin (e.g.). Use “For example,”

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t use bold formatting.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use “it”.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You used a warning - would there be data loss or something critical if they used --tables and --databases?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explains
Always add the referenced object - this what?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result: No test1 tables.
Not a sentence

Copy link
Collaborator

@patrickbirch patrickbirch Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line 52, you tell them to use tables-files, but in line 84 you give them other options.

Line 84 - entirely is redundant.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 95 - you explain that they don’t need to list the database name for the specific databases - that information should be in line 88.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 103 - warning again - this information is a note unless the users will lose data or corrupt their database.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 114 should be in line 108.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all command prompts (something Alina and I are doing now).
Change {.bash data-prompt=“$”} to shell or bash

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mydb table again?

* To back up specific tables, specify them in `database.table` format (e.g., `mydb.mytable`).

!!! warning "No Wildcards or Regex"
The `--databases` option does **not** support wildcards (like `*`) or regular expressions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a blank line between !!! warning (should be a note) and the body of the note.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using a generic .* instead of mydb? Users may not realize that mydb.* is an example.

This option accepts a comma-separated list of database names or table names. To include all tables in a database, simply specify the database name (for example, `mydb`).

Regular expressions are not supported.
!!! warning "No Wildcards or Regex"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a blank line

* To back up an entire database, specify just the database name (e.g., `mydb`).
* To back up a specific table, specify `mydb.mytable`.
* **Do not use** `.*` or regex (e.g., `mydb.*`). These are treated as literal names.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider adding a summary table at the end to make it easier for users.


Regular expressions are not supported.
!!! warning "No Wildcards or Regex"
The `--databases` option does **not** support wildcards (like `*`) or regular expressions. Do not use `mydb.*` as it will search for a literal table named `*`.
Copy link
Collaborator

@patrickbirch patrickbirch Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does --databases support? You should provide the positive (what it does) before the negative (what it doesn't).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just dbnames "mysql,sys,test" or dbname.tablename but you cannot use regex here
like "mysql,sys,test,test2.sbtest*"


If you want to back up specific tables from one database (e.g., `testdb.table1`, `testdb.table2`) while also backing up other databases (e.g., `mysql`, `performance_schema`, `sys`), use `--tables-file` or simply list the tables in `--databases` (or `--databases-file`).

#### Method 1: Using `--tables-file` (Recommended)
Copy link
Collaborator

@patrickbirch patrickbirch Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should include --tables-file in the earlier comparisons. So far, you've only mentioned --tables and --databases. It could be confusing to a user to suddenly have a third option without explanation.

The `--tables` and `--databases` options use different filtering mechanisms and can conflict when used together.

* `--tables` uses regular expressions and implies a partial backup.
* `--databases` uses exact matching and implies a full backup of the listed databases.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about --table-files? Does this option use exact matching?

* `--tables` uses regular expressions and implies a partial backup.
* `--databases` uses exact matching and implies a full backup of the listed databases.

If you use both, you may get unexpected results (for example, a database listed in `--databases` might be fully backed up even if you only wanted specific tables from it via `--tables`). To combine specific tables from one database with full backups of other databases, use `--tables-file` instead of `--tables`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you should add --tables-file in the comparisons.
There should also be a performance hit for using regex (--tables) instead of exact matching (--databases).

* Use the `--databases` option to list the databases
* Use the `--databases` option to list the databases or specific tables

* Use the `--databases-file` option to list the databases
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add links to the options reference for these options.

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

Comments