Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: BackupShard --incremental-from-pos #1557

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/en/docs/18.0/reference/programs/vtctl/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Note that wherever `vtctl` commands produced master or MASTER for tablet type, t
| [ExecuteFetchAsApp](../vtctl/tablets#executefetchasapp) | `ExecuteFetchAsApp -- [--max_rows=10000] [--json] [--use_pool] <tablet alias> <sql command>` |
| [ExecuteFetchAsDba](../vtctl/tablets#executefetchasdba) | `ExecuteFetchAsDba -- [--max_rows=10000] [--disable_binlogs] [--json] <tablet alias> <sql command>` |
| [VReplicationExec](../vtctl/tablets#vreplicationexec) | `VReplicationExec -- [--json] <tablet alias> <sql command>` |
| [Backup](../vtctl/tablets#backup) | `Backup -- [--concurrency=4] [--allow_primary=false] [--upgrade-safe=false] <tablet alias>` |
| [Backup](../vtctl/tablets#backup) | `Backup -- [--concurrency=4] [--allow_primary=false] [--upgrade-safe=false] [--incremental-from-pos=<pos>] <tablet alias>` |
| [RestoreFromBackup](../vtctl/tablets#restorefrombackup) | `RestoreFromBackup <tablet alias>` |
| [ReparentTablet](../vtctl/tablets#reparenttablet) | `ReparentTablet <tablet alias>` |

Expand All @@ -55,7 +55,7 @@ Note that wherever `vtctl` commands produced master or MASTER for tablet type, t
| [RemoveShardCell](../vtctl/shards#removeshardcell) | `RemoveShardCell -- [--force] [--recursive] <keyspace/shard> <cell>` |
| [DeleteShard](../vtctl/shards#deleteshard) | `DeleteShard -- [--recursive] [--even_if_serving] <keyspace/shard> ...` |
| [ListBackups](../vtctl/shards#listbackups) | `ListBackups <keyspace/shard>` |
| [BackupShard](../vtctl/shards#backupshard) | `BackupShard -- [--allow_primary=false] [--upgrade-safe=false] <keyspace/shard>` |
| [BackupShard](../vtctl/shards#backupshard) | `BackupShard -- [--allow_primary=false] [--upgrade-safe=false] <keyspace/shard>` [--incremental_from_pos=<pos>] |
| [RemoveBackup](../vtctl/shards#removebackup) | `RemoveBackup <keyspace/shard> <backup name>` |
| (DEPRECATED) [InitShardPrimary](../vtctl/shards#initshardprimary) | `InitShardPrimary -- [--force] [--wait_replicas_timeout=<duration>] <keyspace/shard> <tablet alias>` |
| [PlannedReparentShard](../vtctl/shards#plannedreparentshard) | `PlannedReparentShard -- --keyspace_shard=<keyspace/shard> [--new_primary=<tablet alias>] [--avoid_tablet=<tablet alias>] [--wait_replicas_timeout=<duration>]` |
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/18.0/reference/programs/vtctl/shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Lists all the backups for a shard.
### BackupShard

```
BackupShard -- [--allow_primary=false] [--upgrade-safe=false] <keyspace/shard>
BackupShard -- [--allow_primary=false] [--upgrade-safe=false] [--incremental-from-pos=<pos>] <keyspace/shard>
```

### RemoveBackup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ vtctldclient ApplySchema [--ddl-strategy <strategy>] [--uuid <uuid> ...] [--migr
### Options

```
--allow-long-unavailability Deprecated and has no effect.
--batch-size int How many queries to batch together. Only applicabel when all queries are CREATE TABLE|VIEW
--caller-id string Effective caller ID used for the operation and should map to an ACL name which grants this identity the necessary permissions to perform the operation (this is only necessary when strict table ACLs are used).
--ddl-strategy string Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'. (default "direct")
-h, --help help for ApplySchema
--migration-context string For Online DDL, optionally supply a custom unique string used as context for the migration(s) in this command. By default a unique context is auto-generated by Vitess.
--skip-preflight Deprecated and has no effect.
--sql stringArray Semicolon-delimited, repeatable SQL commands to apply. Exactly one of --sql|--sql-file is required.
--sql-file string Path to a file containing semicolon-delimited SQL commands to apply. Exactly one of --sql|--sql-file is required.
--uuid strings Optional, comma-delimited, repeatable, explicit UUIDs for migration. If given, must match number of DDL changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ Finds the most up-to-date REPLICA, RDONLY, or SPARE tablet in the given shard an
If no replica-type tablet can be found, the backup can be taken on the primary if --allow-primary is specified.

```
vtctldclient BackupShard [--concurrency <concurrency>] [--allow-primary] [--upgrade-safe] <keyspace/shard>
vtctldclient BackupShard [--concurrency <concurrency>] [--allow-primary] [--incremental-from-pos=<pos>|auto] [--upgrade-safe] <keyspace/shard>
```

### Options

```
--allow-primary Allow the primary of a shard to be used for the backup. WARNING: If using the builtin backup engine, this will shutdown mysqld on the primary and stop writes for the duration of the backup.
--concurrency uint Specifies the number of compression/checksum jobs to run simultaneously. (default 4)
-h, --help help for BackupShard
--upgrade-safe Whether to use innodb_fast_shutdown=0 for the backup so it is safe to use for MySQL upgrades.
--allow-primary Allow the primary of a shard to be used for the backup. WARNING: If using the builtin backup engine, this will shutdown mysqld on the primary and stop writes for the duration of the backup.
--concurrency uint Specifies the number of compression/checksum jobs to run simultaneously. (default 4)
-h, --help help for BackupShard
--incremental-from-pos string Position of previous backup. Default: empty. If given, then this backup becomes an incremental backup from given position. If value is 'auto', backup taken from last successful backup position
--upgrade-safe Whether to use innodb_fast_shutdown=0 for the backup so it is safe to use for MySQL upgrades.
```

### Options inherited from parent commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vtctldclient UpdateThrottlerConfig [--enable|--disable] [--threshold=<float64>]
--threshold float threshold for the either default check (replication lag seconds) or custom check
--throttle-app string an app name to throttle
--throttle-app-duration duration duration after which throttled app rule expires (app specififed in --throttled-app) (default 1h0m0s)
--throttle-app-exempt exempt this app from being at all throttled. WARNING: use with extreme care, as this is likely to push metrics beyond the throttler's threshold, and starve other apps
--throttle-app-ratio float ratio to throttle app (app specififed in --throttled-app) (default 1)
--unthrottle-app string an app name to unthrottle
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ vtctldclient --server=<vtctld_host>:<vtctld_port> BackupShard [--allow_primary=f

## Create an incremental backup with vtctl

An incremental backup requires additional information: the point from which to start the backup. An incremental backup is taken by supplying `--incremental-from-pos` to the `Backup` command. The argument may either indicate a valid position, or the value `auto`. Examples:
An incremental backup requires additional information: the point from which to start the backup. An incremental backup is taken by supplying `--incremental-from-pos` to the `Backup` or `BackupShard` command. The argument may either indicate a valid position, or the value `auto`. Examples:

```sh
vtctldclient Backup --incremental-from-pos="MySQL56/0d7aaca6-1666-11ee-aeaf-0a43f95f28a3:1-53" zone1-0000000102

vtctldclient Backup --incremental-from-pos="0d7aaca6-1666-11ee-aeaf-0a43f95f28a3:1-53" zone1-0000000102

vtctldclient Backup --incremental-from-pos="auto" zone1-0000000102

vtctldclient BackupShard --incremental-from-pos=auto commerce/0
```

When indicating a position, you may choose to use or to omit the `MySQL56/` prefix (which you can find in the backup manifest's Position).
Expand All @@ -122,8 +124,6 @@ An incremental backup fails in these scenarios:
- It is unable to find binary log files that covers the requested position. This can happen if the binary logs are purged earlier than the incremental backup was taken. It essentially means there's a gap in the changelog events. **Note** that while on one tablet the binary logs may be missing, another tablet may still have binary logs that cover the requested position.
- There is no change to the database since the requested position, i.e. the GTID position has not changed since.

`v17` only supports `--incremental-from-pos` in the `Backup` command, not in `BackupShard`. Also, only `vtctlclient` supports the flag, where `vtctldclient` does not. `v18` is expected to support incremental backups for `BackupShard` and for `vtctldclient`.

## Backing up Topology Server

The Topology Server stores metadata (and not tablet data). It is recommended to create a backup using the method described by the underlying plugin:
Expand Down