When using the NFS backup driver if we do multiple backups using the
same container we end up overwriting older backups.
The issue comes from a misunderstanding in the Posix backup driver of
the purpose of the "prefix" metadata used in the ChunkedBackupDriver
base class.
This prefix is for the name of the backup objects to store, but unlike
the prefix for the volumes, here it must be unique as the base driver
will only add numbers to identify the chunk (for the volume we add the
volume id). Unfortunately the Posix driver just assumed that the prefix
had the same meaning as the prefix for volumes thus making one backups
override one another.
This patch changes the prefix generated by the Posix driver so we have
the following format: "volume_$VOL_ID_$TIMESTAMP_backup_$BACK_ID", thus
allowing multiple backups in the same container.
The new name is backward compatible with existing backups because the
new prefix will only be used on new backups as the prefix for already
existing backups is stored in the DB.
Change-Id: I2903c27633facde6370d95ba0b9e06025ccaef26
Closes-Bug: #1628768
(cherry picked from commit 535e71797031c3d3e3a5e2023c5ede470b02e3a7)
(cherry picked from commit 640b9dc2b739b04f1f7d70c2172f5b5fbc3b9b28)
Reviewed: https:/ /review. openstack. org/467267 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=bc1e8d67821 06ec1f0fb4ebb1a fa3f7269a4f063
Committed: https:/
Submitter: Jenkins
Branch: driverfixes/newton
commit bc1e8d6782106ec 1f0fb4ebb1afa3f 7269a4f063
Author: Gorka Eguileor <email address hidden>
Date: Thu May 18 10:28:43 2017 +0200
NFS Backup: Fix overwritting backups
When using the NFS backup driver if we do multiple backups using the
same container we end up overwriting older backups.
The issue comes from a misunderstanding in the Posix backup driver of
the purpose of the "prefix" metadata used in the ChunkedBackupDriver
base class.
This prefix is for the name of the backup objects to store, but unlike
the prefix for the volumes, here it must be unique as the base driver
will only add numbers to identify the chunk (for the volume we add the
volume id). Unfortunately the Posix driver just assumed that the prefix
had the same meaning as the prefix for volumes thus making one backups
override one another.
This patch changes the prefix generated by the Posix driver so we have $VOL_ID_ $TIMESTAMP_ backup_ $BACK_ID" , thus
the following format: "volume_
allowing multiple backups in the same container.
The new name is backward compatible with existing backups because the
new prefix will only be used on new backups as the prefix for already
existing backups is stored in the DB.
Change-Id: I2903c27633facd e6370d95ba0b9e0 6025ccaef26 3e3a5e2023c5ede 470b02e3a7) f1f7d70c2172f5b 5fbc3b9b28)
Closes-Bug: #1628768
(cherry picked from commit 535e71797031c3d
(cherry picked from commit 640b9dc2b739b04