vtbackup

command
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Copyright 2019 The Vitess Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

vtbackup is a batch command to perform a single pass of backup maintenance for a shard.

When run periodically for each shard, vtbackup can ensure these configurable policies: * There is always a recent backup for the shard. * Old backups for the shard are removed.

Whatever system launches vtbackup is responsible for the following:

  • Running vtbackup with similar flags that would be used for a vttablet and mysqlctld in the target shard to be backed up.
  • Provisioning as much disk space for vtbackup as would be given to vttablet. The data directory MUST be empty at startup. Do NOT reuse a persistent disk.
  • Running vtbackup periodically for each shard, for each backup storage location.
  • Ensuring that at most one instance runs at a time for a given pair of shard and backup storage location.
  • Retrying vtbackup if it fails.
  • Alerting human operators if the failure is persistent.

The process vtbackup follows to take a new backup is as follows:

  1. Restore from the most recent backup.
  2. Start a mysqld instance (but no vttablet) from the restored data.
  3. Instruct mysqld to connect to the current shard master and replicate any transactions that are new since the last backup.
  4. Ask the master for its current replication position and set that as the goal for catching up on replication before taking the backup, so the goalposts don't move.
  5. Wait until replication is caught up to the goal position or beyond.
  6. Stop mysqld and take a new backup.

Aside from additional replication load while vtbackup's mysqld catches up on new transactions, the shard should be otherwise unaffected. Existing tablets will continue to serve, and no new tablets will appear in topology, meaning no query traffic will ever be routed to vtbackup's mysqld. This silent operation mode helps make backups minimally disruptive to serving capacity and orthogonal to the handling of the query path.

The command-line parameters to vtbackup specify a policy for when a new backup is needed, and when old backups should be removed. If the existing backups already satisfy the policy, then vtbackup will do nothing and return success immediately.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL