Bug #39455
closed"rbd diff" reports diff on freshly-created image
0%
Description
While working on #39447 I was surprised to find that "rbd diff" reports a diff in the following case:
Starting from a freshly deployed nautilus cluster:
ceph osd pool create rbd 30 30 replicated dd if=/bin/sh of=/tmp/img1 bs=1k count=1 seek=10 dd if=/bin/dd of=/tmp/img1 bs=1k count=10 seek=100 dd if=/bin/rm of=/tmp/img1 bs=1k count=100 seek=1000 dd if=/bin/ls of=/tmp/img1 bs=1k seek=10000 dd if=/bin/ln of=/tmp/img1 bs=1k seek=100000 rbd import /tmp/img1 testimg1 rbd diff testimg1
The last command produces the following output:
# rbd diff testimg1 Offset Length Type 0 1089536 data 8388608 1986560 data 100663296 1805336 data
My expectation based on reading the rbd manpage ("diff - Dump a list of byte extents in the image that have changed since the specified start snapshot, or since the image was created") would be that the command would not produce any output (i.e., no diff).
If I then make a snapshot and diff against the snapshot, the behavior is as expected:
# rbd snap create testimg1 --snap=snap1 # rbd diff --from-snap=snap1 testimg1 #
Updated by Nathan Cutler about 5 years ago
- Related to Bug #39447: [tests] "rbd" teuthology suite has no coverage of "rbd diff" added
Updated by Nathan Cutler about 5 years ago
- Subject changed from "rbd diff" reports a diff on a freshly-created image to "rbd diff" reports diff on freshly-created image
Updated by Jason Dillaman about 5 years ago
- Status changed from New to Need More Info
My expectation based on reading the rbd manpage ("diff - Dump a list of byte extents in the image that have changed since the specified start snapshot, or since the image was created") would be that the command would not produce any output (i.e., no diff).
Since you didn't provide a "--from-snap" argument, it's hitting the second condition of "since the image was created". Note that import is really create+populate, so the diff is the data you populated (i.e. the non-zeroed extents).
Updated by Nathan Cutler almost 5 years ago
- Status changed from Need More Info to Rejected
works as designed