Project

General

Profile

Bug #39455

"rbd diff" reports diff on freshly-created image

Added by Nathan Cutler about 2 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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 
#

Related issues

Related to rbd - Bug #39447: [tests] "rbd" teuthology suite has no coverage of "rbd diff" Resolved 04/24/2019

History

#1 Updated by Nathan Cutler about 2 years ago

  • Related to Bug #39447: [tests] "rbd" teuthology suite has no coverage of "rbd diff" added

#2 Updated by Nathan Cutler about 2 years ago

  • Description updated (diff)

#3 Updated by Nathan Cutler about 2 years ago

  • Description updated (diff)

#4 Updated by Nathan Cutler about 2 years ago

  • Subject changed from "rbd diff" reports a diff on a freshly-created image to "rbd diff" reports diff on freshly-created image

#5 Updated by Jason Dillaman about 2 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).

#6 Updated by Nathan Cutler about 2 years ago

  • Status changed from Need More Info to Rejected

works as designed

Also available in: Atom PDF