PXB-3662: Clarify --tables and --databases conflict in docs#452
PXB-3662: Clarify --tables and --databases conflict in docs#452satya-bodapati wants to merge 2 commits intopercona:8.0from
Conversation
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.
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
Do not use Latin (e.g.). Use “For example,”
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
Don’t use bold formatting.
docs/create-partial-backup.md
Outdated
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
You used a warning - would there be data loss or something critical if they used --tables and --databases?
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
This explains
Always add the referenced object - this what?
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
Result: No test1 tables.
Not a sentence
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
In line 52, you tell them to use tables-files, but in line 84 you give them other options.
Line 84 - entirely is redundant.
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
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.
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
Line 103 - warning again - this information is a note unless the users will lose data or corrupt their database.
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
Line 114 should be in line 108.
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
Remove all command prompts (something Alina and I are doing now).
Change {.bash data-prompt=“$”} to shell or bash
docs/create-partial-backup.md
Outdated
| * 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. |
There was a problem hiding this comment.
add a blank line between !!! warning (should be a note) and the body of the note.
docs/create-partial-backup.md
Outdated
There was a problem hiding this comment.
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" |
| * 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. | ||
|
|
There was a problem hiding this comment.
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 `*`. |
There was a problem hiding this comment.
What does --databases support? You should provide the positive (what it does) before the negative (what it doesn't).
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
add links to the options reference for these options.
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:
--databasesacts as a high-level filter that precedes table-level checks, which can override--tablesregex patterns.docs/create-partial-backup.mdto demonstrate why mixing these options fails.--tables-filealongside--databases.docs/xtrabackup-option-reference.mdto accurately describe the conflict and interaction between these parameters.