Bug #42248
closedrbd export-diff with --whole-object skips parent data for fast-diff enabled images
0%
Description
we've noticed, that when we create snapshot of fast-diff enabled image,
and then export diff with --whole-object parameter, exported data seem
to be incorrect..
steps to reproduce:
[root@showboxv1a ~]# dd if=/dev/zero of=/tmp/disk.img bs=1M count=1
[root@showboxv1a ~]# mkfs.ext4 /tmp/disk.img
[root@showboxv1a ~]# rbd import /tmp/disk.img sata/mkr-test1
[root@showboxv1a ~]# rbd info sata/mkr-test1
rbd image 'mkr-test1':
size 1 MiB in 1 objects
order 22 (4 MiB objects)
id: 0ed94a6b8b4567
block_name_prefix: rbd_data.0ed94a6b8b4567
format: 2
features: layering, exclusive-lock, object-map, fast-diff,
deep-flatten
op_features:
flags:
create_timestamp: Thu Sep 19 16:07:42 2019
[root@showboxv1a ~]# rbd du sata/mkr-test1
NAME PROVISIONED USED
mkr-test1 1 MiB 1 MiB
[root@showboxv1a ~]# rbd export-diff sata/mkr-test1 - | wc -c
Exporting image: 100% complete...done.
45095
[root@showboxv1a ~]# rbd export-diff sata/mkr-test1 - --whole-object | wc
-c
Exporting image: 100% complete...done.
1048615
- this is OK
[root@showboxv1a ~]# rbd snap create sata/mkr-test1@snap1
[root@showboxv1a ~]# rbd snap protect sata/mkr-test1@snap1
[root@showboxv1a ~]# rbd clone sata/mkr-test1@snap1 sata/mkr-test1b
[root@showboxv1a ~]# rbd du sata/mkr-test1b
NAME PROVISIONED USED
mkr-test1b 1 MiB 0 B
[root@showboxv1a ~]# rbd export-diff sata/mkr-test1b - | wc -c
Exporting image: 100% complete...done.
45095
this is OK too
[root@showboxv1a ~]# rbd export-diff sata/mkr-test1b - --whole-object | wc
-c
Exporting image: 100% complete...done.
22
- this is wrong, size should apparently be larger
or do we get all this wrong?
problem is reproducible for both 13.2.6 and 14.2.3, host OS is x86_64 centos 7.