New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librbd: create+truncate for whole-object layered discards #20809
librbd: create+truncate for whole-object layered discards #20809
Conversation
... otherwise object map expectations aren't actually set. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
…cate This is !is_no_op_for_nonexistent_object() test -- NONEXISTENT case is the interesting one. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@idryomov Can you create a tracker ticket for this issue so that it can be backported to jewel and luminous? |
A whole-object layered discard is implemented as a truncate rather than a delete: a dummy object is needed to prevent the CoW machinery from kicking in. However, a truncate on a non-existent object is a no-op. If the object doesn't exist in HEAD, a discard request is effectively ignored -- parent blocks are still seen afterwards. A non-exclusive create on an existing object is also a no-op, so the fix is to do a compound create+truncate instead. Fixes: http://tracker.ceph.com/issues/23285 Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
4909f3e
to
0514480
Compare
Created and rebased to link it from the commit. |
retest this please |
retest this please |
2 similar comments
retest this please |
retest this please |
(I'm really scratching my head to figure out why the |
retest this please |
Merged manually |
…ncate librbd: create+truncate for whole-object layered discards Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Undo the fixup made in merge commit a7351ce ("Merge pull request ceph#20809 from idryomov/wip-librbd-discard-create-truncate"). We do want to observe the object map interaction here -- specific changes towards that were made in commits 513baf9 ("test/librbd: clone with parent features in DiscardRemoveTruncate") and 9d6ee9a ("test/librbd: expect_object_may_exist(..., false) in DiscardRemoveTruncate"). Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
No description provided.