Skip to content
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

Merged
merged 3 commits into from Mar 11, 2018

Conversation

idryomov
Copy link
Contributor

@idryomov idryomov commented Mar 8, 2018

No description provided.

... 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>
Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dillaman
Copy link

dillaman commented Mar 8, 2018

@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>
@idryomov idryomov force-pushed the wip-librbd-discard-create-truncate branch from 4909f3e to 0514480 Compare March 9, 2018 09:20
@idryomov
Copy link
Contributor Author

idryomov commented Mar 9, 2018

Created and rebased to link it from the commit.

@idryomov
Copy link
Contributor Author

idryomov commented Mar 9, 2018

retest this please

@dillaman
Copy link

dillaman commented Mar 9, 2018

retest this please

2 similar comments
@dillaman
Copy link

dillaman commented Mar 9, 2018

retest this please

@dillaman
Copy link

retest this please

@dillaman
Copy link

(I'm really scratching my head to figure out why the make check builders hate this PR)

@dillaman
Copy link

retest this please

@dillaman
Copy link

Merged manually

@dillaman dillaman closed this Mar 11, 2018
@dillaman dillaman merged commit 0514480 into ceph:master Mar 11, 2018
dillaman pushed a commit that referenced this pull request Mar 11, 2018
…ncate

librbd: create+truncate for whole-object layered discards

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
@idryomov idryomov deleted the wip-librbd-discard-create-truncate branch March 15, 2018 21:43
idryomov added a commit to idryomov/ceph that referenced this pull request Mar 7, 2019
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants