Project

General

Profile

Actions

Bug #53897

closed

diff-iterate can report holes when diffing against the beginning of time (fromsnapname == NULL)

Added by Ilya Dryomov over 2 years ago. Updated 2 months ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
% Done:

0%

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

Description

rbd_diff_iterate/rbd_diff_iterate2() API documentation says:

If the source snapshot name is NULL, we interpret that as the beginning of time and return all allocated regions of the image.

Based on this sentence, the user can rightfully assume that the callback would only be invoked for allocated areas (i.e. with exists=true). However, if there is a snapshot which contains a discarded object, diff-iterate reports holes (exists=false) even when diffing against the beginning of time:

$ rbd create --size 16M foo
$ sudo rbd map foo
/dev/rbd0
$ sudo xfs_io -d -c 'pwrite -b 4M 0 16M' /dev/rbd0
wrote 16777216/16777216 bytes at offset 0
16 MiB, 4 ops; 0.4607 sec (34.726 MiB/sec and 8.6814 ops/sec)
$ rbd snap create foo@snap
Creating snap: 100% complete...done.
$ rbd diff foo
Offset    Length   Type
0         4194304  data
4194304   4194304  data
8388608   4194304  data
12582912  4194304  data

$ blkdiscard -o 4M -l 8M /dev/rbd0
$ rbd diff foo
Offset    Length   Type
0         4194304  data
4194304   4194304  zero
8388608   4194304  zero
12582912  4194304  data

Removing such a snapshot makes these "holes" disappear from the report:

$ rbd snap rm foo@snap
Removing snap: 100% complete...done.
$ rbd diff foo
Offset    Length   Type
0         4194304  data
12582912  4194304  data

If nothing depends on this quirk, it should be fixed. Otherwise, the documentation needs to be updated to mention this.


Related issues 7 (2 open5 closed)

Related to rbd - Bug #63719: [test] scribble()-based DiffIterate tests are too weakNew

Actions
Related to rbd - Bug #63770: [diff-iterate] discards that truncate aren't accounted for by ObjectListSnapsRequestPending BackportIlya Dryomov

Actions
Blocks rbd - Feature #63341: improve rbd_diff_iterate2() performance in fast-diff modeResolvedIlya Dryomov

Actions
Blocked by rbd - Bug #63654: [diff-iterate] ObjectListSnapsRequest's LIST_SNAPS_FLAG_WHOLE_OBJECT behavior is brokenResolvedIlya Dryomov

Actions
Copied to rbd - Backport #63846: pacific: diff-iterate can report holes when diffing against the beginning of time (fromsnapname == NULL)ResolvedIlya DryomovActions
Copied to rbd - Backport #63847: quincy: diff-iterate can report holes when diffing against the beginning of time (fromsnapname == NULL)ResolvedIlya DryomovActions
Copied to rbd - Backport #63848: reef: diff-iterate can report holes when diffing against the beginning of time (fromsnapname == NULL)ResolvedIlya DryomovActions
Actions

Also available in: Atom PDF