-
Notifications
You must be signed in to change notification settings - Fork 741
Ensure max backup bug #2113
Ensure max backup bug #2113
Comments
@alynlin I'm seeing behavior where the backup being deleted to ensure a maximum number of backups isn't necessarily the oldest backup, resulting in the latest backup possibly being deleted instead, and leaving around much older backups. Is this what you are describing? I see in For my local build, I will try changing this line in
|
On second thought, I'm going to try submitting a solution that fixes the sorting instead of changing the format of the backup paths, to make the fix backwards-compatible with current deployments. |
…n of only the oldest backups when rotating When rotating backups based on a maximum number allowed, newer backups were being deleted when the number of digits in an etcd store revision increased. E.g., when "v99" became "v100", the newer "v100" backup was being deleted, because the "1" in "100" was sorted to come before the first "9" in "99". This new sorting method relies on the timestamp in each backup path, rather than the revision number. The reason the timestamp is given precedence over the revision when sorting is because the revision could potentially go backwards when an older backup is restored. See my comment in pkg/backup/util/util.go's SortableBackupPaths type for more details. Fixes coreos#2113
…n of only the oldest backups when rotating When rotating backups based on a maximum number allowed, newer backups were being deleted when the number of digits in an etcd store revision increased. E.g., when "v99" became "v100", the newer "v100" backup was being deleted, because the "1" in "100" was sorted to come before the first "9" in "99". This new sorting method relies on the timestamp in each backup path, rather than the revision number. The reason the timestamp is given precedence over the revision when sorting is because the revision could potentially go backwards when an older backup is restored. See my comment in pkg/backup/util/util.go's SortableBackupPaths type for more details. Fixes coreos#2113
When etcd max revision reaches the next order of magnitude, the deleted expired file is the latest backup file.
The text was updated successfully, but these errors were encountered: