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

cls/cmpomap: add cls module for CMPXATTR-like functionality in omap #33982

Merged
merged 7 commits into from Apr 13, 2020

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Mar 15, 2020

provides a cmp_vals() op similar to librados' omap_cmp(), but with full support for the comparison modes and operations from cmpxattr(). if any of the requested key/value comparisons are unsuccessful, the op fails with -ECANCELED

cmp_vals() can be composed with other ops like set_omap_vals() to make make them conditional on the successful comparison of all existing values

also provides cmp_set_vals() and cmp_rm_keys(), which apply a mutation to only the keys that compare successfully. these enable batch operations where, unlike cmp_vals() + set_omap_vals(), you don't want one failed comparison to prevent operations on unrelated keys

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@cbodley
Copy link
Contributor Author

cbodley commented Mar 20, 2020

see the rgw_error_repo_ primitives in #34094 for the motivating use case

src/cls/cmpomap/server.cc Outdated Show resolved Hide resolved
@cbodley cbodley force-pushed the wip-cls-cmpomap branch 2 times, most recently from 709f84b to bc15cd3 Compare April 1, 2020 13:50
@cbodley
Copy link
Contributor Author

cbodley commented Apr 8, 2020

@yuvalif i pushed an update that changes the interfaces so that the Mode and Op are specified once per call, rather than for each key. i also added a std::optional<bufferlist> argument to cmp_vals() and cmp_set_vals() to specify a default value to use for keys that don't exist, and if no default is given, the comparison fails

@yuvalif yuvalif self-requested a review April 12, 2020 09:00
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
this was defined in osd/objclass.cc but not declared in objclass/objclass.h

Signed-off-by: Casey Bodley <cbodley@redhat.com>
add an objclass api for CEPH_OSD_OP_OMAPGETVALSBYKEYS

Signed-off-by: Casey Bodley <cbodley@redhat.com>
provides a cmp_vals() op similar to librados' omap_cmp(), but with full
support for the comparison modes and operations from cmpxattr(). if any
of the requested key/value comparisons are unsuccessful, the op fails
with -ECANCELED

cmp_vals() can be composed with other ops like set_omap_vals() to make
make them conditional on the successful comparison of all existing values

also provides cmp_set_vals() and cmp_rm_keys(), which apply a mutation
to only the keys that compare successfully. these enable batch
operations where, unlike cmp_vals() + set_omap_vals(), you don't want
one failed comparison to prevent operations on unrelated keys

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley cbodley merged commit 3f2e593 into ceph:master Apr 13, 2020
@cbodley cbodley deleted the wip-cls-cmpomap branch April 13, 2020 15:07
@tchaikov
Copy link
Contributor

the newly added test fails. i filed https://tracker.ceph.com/issues/45113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants