diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2012-07-23 14:05:53 -0700 |
---|---|---|
committer | Josh Durgin <josh.durgin@inktank.com> | 2012-07-23 14:09:58 -0700 |
commit | 7dfdf4f8de16155edd434534e161e06ba7c79d7d (patch) | |
tree | 711a08dc36432698a990db5931903f1ca5fce95f /src/librbd | |
parent | dc2d67112163bee8b111f75ae3e3ca42884b09b4 (diff) | |
download | ceph-7dfdf4f8de16155edd434534e161e06ba7c79d7d.tar.gz |
librbd: replace assign_bid with client id and random number
The assign_bid method has issues with replay because it is a write
that also returns data. This means that the replayed operation would
return success, but no data, and cause a create to fail. Instead, let
the client set the bid based on its global id and a random number.
This only affects the creation of new images, since the bid is put
into an opaque string as part of the object prefix.
Keep the server side assign_bid around in case there are old clients
still using it.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'src/librbd')
-rw-r--r-- | src/librbd/cls_rbd_client.cc | 18 | ||||
-rw-r--r-- | src/librbd/cls_rbd_client.h | 3 |
2 files changed, 0 insertions, 21 deletions
diff --git a/src/librbd/cls_rbd_client.cc b/src/librbd/cls_rbd_client.cc index cb42eb7c178..69b3fdd8b73 100644 --- a/src/librbd/cls_rbd_client.cc +++ b/src/librbd/cls_rbd_client.cc @@ -246,24 +246,6 @@ namespace librbd { return 0; } - int assign_bid(librados::IoCtx *ioctx, const std::string &oid, - uint64_t *id) - { - bufferlist bl, out; - int r = ioctx->exec(oid, "rbd", "assign_bid", bl, out); - if (r < 0) - return r; - - try { - bufferlist::iterator iter = out.begin(); - ::decode(*id, iter); - } catch (const buffer::error &err) { - return -EBADMSG; - } - - return 0; - } - int old_snapshot_add(librados::IoCtx *ioctx, const std::string &oid, uint64_t snap_id, const std::string &snap_name) { diff --git a/src/librbd/cls_rbd_client.h b/src/librbd/cls_rbd_client.h index 79654480546..2a9da7d079a 100644 --- a/src/librbd/cls_rbd_client.h +++ b/src/librbd/cls_rbd_client.h @@ -46,9 +46,6 @@ namespace librbd { std::vector<string> *names, std::vector<uint64_t> *sizes, std::vector<uint64_t> *features); - int assign_bid(librados::IoCtx *ioctx, const std::string &oid, - uint64_t *id); - // class operations on the old format, kept for // backwards compatability |