-
Notifications
You must be signed in to change notification settings - Fork 93
Bug Report: VitessBackupSchedule silently ignores extraFlags when using vtbackup #768
Description
Summary
VitessBackupScheduleStrategy.extraFlags is documented as flags passed to vtctldclient, but VitessBackupSchedule only uses vtbackup under the hood.
As a result, any flags specified in extraFlags — including incremental-from-pos: auto — are silently ignored and never passed to the vtbackup container.
This causes a critical silent misconfiguration: users believe they are taking incremental backups, but full backups are being taken instead.
Steps to Reproduce
- Create a VitessBackupSchedule with an extraFlags entry:
strategies:
- extraFlags:
incremental-from-pos: auto
keyspace: unsharded
name: unsharded-x-x
shard: '-'
- Wait for the schedule to trigger a backup job.
- Inspect the created vtbackup pod's container args.
Expected Behavior
The extraFlags entry incremental-from-pos: auto should be passed to the vtbackup container as --incremental-from-pos=auto, resulting in an incremental backup.
Actual Behavior
The vtbackup container is launched without --incremental-from-pos. No error or warning is surfaced. A full backup is taken silently.
vtbackup pod args (relevant excerpt):
- --backup_engine_implementation=xtrabackup
- --initial_backup=false
...
# --incremental-from-pos is absent
Manually running vtbackup with --incremental-from-pos=auto confirms incremental backup works correctly, producing binlog-only output:
found 1 files to backup
Backing up file: vt-1805737721-bin.000001
Backup successful.
Root Cause
The extraFlags field on VitessBackupScheduleStrategy is documented as:
ExtraFlags is a map of flags that will be sent down to vtctldclient when taking the backup.
Since VitessBackupSchedule only provisions vtbackup pods (not vtctldclient), the flags are never applied. The documentation is misleading and the operator has no code path to forward extraFlags to the vtbackup container arguments.
Impact
Potential bigger backup/storage costs: Users configure incremental-from-pos: auto expecting incremental backups but receive full backups without any indication of failure.
The VitessBackupSchedule status shows successful jobs, giving a false sense of correctness.
Proposed Fix
Either:
- Pass extraFlags to the vtbackup container args when the schedule uses vtbackup (rename/clarify the field accordingly), or
- Emit a warning or validation error when extraFlags contains vtbackup-specific flags that cannot be forwarded, and
- Update the extraFlags documentation to accurately reflect which flags are supported and for which backend.