Skip to content

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

Merged
cbodley merged 7 commits into
ceph:masterfrom
cbodley:wip-cls-cmpomap
Apr 13, 2020
Merged

cbodley merged 7 commits into
ceph:masterfrom
cbodley:wip-cls-cmpomap

Conversation

@cbodley

@cbodley cbodley commented Mar 15, 2020

Copy link
Copy Markdown
Contributor

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

cbodley commented Mar 20, 2020

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/cls/cmpomap/server.cc Resolved
Comment thread src/cls/cmpomap/server.cc Resolved
Comment thread src/cls/cmpomap/server.cc Resolved
Comment thread src/cls/cmpomap/types.h 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

cbodley commented Apr 8, 2020

Copy link
Copy Markdown
Contributor Author

@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
cbodley added 7 commits April 13, 2020 09:23
this was defined in osd/objclass.cc but not declared in objclass/objclass.h

Signed-off-by: Casey Bodley <[email protected]>
add an objclass api for CEPH_OSD_OP_OMAPGETVALSBYKEYS

Signed-off-by: Casey Bodley <[email protected]>
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 <[email protected]>
@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
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants