Skip to content

Commit

Permalink
librados: synchronous commands should return on commit instead of ack
Browse files Browse the repository at this point in the history
This is unlikely to be noticed by anybody, but it is a big change. Document
in the PendingReleaseNotes and bump up the librados minor version number
to 68.

Signed-off-by: Greg Farnum <[email protected]>
  • Loading branch information
gregsfortytwo committed Aug 19, 2013
1 parent f5636be commit 4e86be9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions PendingReleaseNotes
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ v0.68
offender, has been removed. This breaks compatibility with
pre-bobtail librbd clients by preventing them from creating new
images.

* librados now returns on commit instead of ack for synchronous calls.
This is a bit safer in the case where both OSDs and the client crash, and
is probably how it should have been acting from the beginning. Users are
unlikely to notice but it could result in lower performance in some
circumstances. Those who care should switch to using the async interfaces,
which let you specify safety semantics precisely.
2 changes: 1 addition & 1 deletion src/include/rados/librados.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern "C" {
#endif

#define LIBRADOS_VER_MAJOR 0
#define LIBRADOS_VER_MINOR 53
#define LIBRADOS_VER_MINOR 68
#define LIBRADOS_VER_EXTRA 0

#define LIBRADOS_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra)
Expand Down
4 changes: 2 additions & 2 deletions src/librados/IoCtxImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,14 @@ int librados::IoCtxImpl::operate(const object_t& oid, ::ObjectOperation *o,
int r;
eversion_t ver;

Context *onack = new C_SafeCond(&mylock, &cond, &done, &r);
Context *oncommit = new C_SafeCond(&mylock, &cond, &done, &r);

int op = o->ops[0].op.op;
ldout(client->cct, 10) << ceph_osd_op_name(op) << " oid=" << oid << " nspace=" << oloc.nspace << dendl;
lock->Lock();
objecter->mutate(oid, oloc,
*o, snapc, ut, 0,
onack, NULL, &ver);
NULL, oncommit, &ver);
lock->Unlock();

mylock.Lock();
Expand Down

0 comments on commit 4e86be9

Please sign in to comment.