Project

General

Profile

Actions

Bug #24173

closed

ceph_volume_client: allow atomic update of RADOS objects

Added by Ramana Raja almost 6 years ago. Updated about 5 years ago.

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

0%

Source:
Development
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
5 - suggestion
Reviewed:
Affected Versions:
ceph-qa-suite:
fs
Component(FS):
VolumeClient
Labels (FS):
Manila
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The manila driver needs the ceph_volume_client to atomically update contents
of RADOS objects used to store ganesha's export counter and ganesha's
export RADOS URL index.


Related issues 3 (0 open3 closed)

Related to CephFS - Bug #38946: ceph_volume_client: Too many arguments for "WriteOpCtx"ResolvedRamana Raja

Actions
Copied to CephFS - Backport #24862: luminous: ceph_volume_client: allow atomic update of RADOS objectsResolvedPatrick DonnellyActions
Copied to CephFS - Backport #24863: mimic: ceph_volume_client: allow atomic update of RADOS objectsResolvedNathan CutlerActions
Actions #1

Updated by Ramana Raja almost 6 years ago

Greg Farnum's suggestions to do atomic RADOS object updates,

"If you've already got code that does all these things and just want to make sure it's not racy, there are a few options. Basically, you need a version, and on every write you make sure the version is what you expect. The basic outline is
1) read the object (as I assume you already do), along with its version
2) update the object in-memory, and then write it out using our compound operations. (In the C++ code these are ObjectOperations, or for updates an ObjectWriteOperation. I saw a rados_write_op_t in the python bindings which I suspect is the same) The operation will be two pieces, 1) assert that the version is as expected (and fail if not), then 2) do the write.
3) If the operation failed because the version is wrong, loop back to 1 and try again.

There are two options for getting a version ID. The first is that every object in RADOS actually has a version which is updated on every op, and you can just use that. In this case, on the read reply you'd invoke get_version() on the read completion, and then invoke assert_version() on the write op.
These versions are nice because you don't have to maintain them, but while they're unique and monotonic they will definitely not be sequential, and you're stuck with just the integer value.

The other option is to maintain a version yourself in an object xattr. In that case, you'd make sure on reads to get the xattr (not just the object data), and then on the write operation you'd cmp_xattr("my_xattr", CEPH_OSD_CMPXATTR_OP_EQ, bufferlist_of_previous_value) as the first operation, and then as your last operation you'd do setxattr("my_xattr", bufferlist_of_new_value). If you want to maintain the Ganesha export IDs in a specific format or sequence, this would be the way to go. (And indeed it's just those two operations.)
(Those are all the C++ function names, btw — I imagine you can work out the python interfaces with those keywords but I haven't used it at all.) "

I think the first option is easier to implement.

Actions #2

Updated by Patrick Donnelly almost 6 years ago

  • Target version set to v14.0.0
  • Backport set to mimic,luminous
  • Severity changed from 3 - minor to 5 - suggestion
  • Labels (FS) task(intern) added
Actions #3

Updated by Rishabh Dave almost 6 years ago

  • Status changed from New to In Progress
Actions #4

Updated by Patrick Donnelly almost 6 years ago

  • Status changed from In Progress to Pending Backport
Actions #5

Updated by Patrick Donnelly almost 6 years ago

  • Copied to Backport #24862: luminous: ceph_volume_client: allow atomic update of RADOS objects added
Actions #6

Updated by Patrick Donnelly almost 6 years ago

  • Copied to Backport #24863: mimic: ceph_volume_client: allow atomic update of RADOS objects added
Actions #7

Updated by Nathan Cutler over 5 years ago

  • Status changed from Pending Backport to Resolved
Actions #8

Updated by Patrick Donnelly about 5 years ago

  • Category deleted (87)
  • Labels (FS) Manila added
  • Labels (FS) deleted (task(intern))
Actions #9

Updated by Patrick Donnelly about 5 years ago

  • Related to Bug #38946: ceph_volume_client: Too many arguments for "WriteOpCtx" added
Actions

Also available in: Atom PDF