Merge remote-tracking branch 'gh/next'

This commit is contained in:
Sage Weil 2015-01-09 21:43:49 -08:00
commit 585efcb7e4
7 changed files with 45 additions and 43 deletions

View File

@ -660,7 +660,7 @@ core-daemons: ceph-mon ceph-osd ceph-mds radosgw
admin-tools: monmaptool osdmaptool crushtool ceph-authtool
base: core-daemons admin-tools \
cephfs ceph-syn ceph-conf \
rados librados-config \
rados radosgw-admin librados-config \
init-ceph ceph_mon_store_converter ceph-post-file \
ceph

View File

@ -8388,8 +8388,11 @@ void OSD::process_peering_events(
continue;
}
if (!advance_pg(curmap->get_epoch(), pg, handle, &rctx, &split_pgs)) {
pg->queue_null(curmap->get_epoch(), curmap->get_epoch());
} else if (!pg->peering_queue.empty()) {
// we need to requeue the PG explicitly since we didn't actually
// handle an event
peering_wq.queue(pg);
} else {
assert(!pg->peering_queue.empty());
PG::CephPeeringEvtRef evt = pg->peering_queue.front();
pg->peering_queue.pop_front();
pg->handle_peering_event(evt, &rctx);

View File

@ -1271,16 +1271,25 @@ void Objecter::_check_op_pool_dne(Op *op, bool session_locked)
{
assert(rwlock.is_wlocked());
ldout(cct, 10) << "check_op_pool_dne tid " << op->tid
<< " current " << osdmap->get_epoch()
<< " map_dne_bound " << op->map_dne_bound
<< dendl;
if (op->attempts) {
// we send a reply earlier, which means that previously the pool
// existed, and now it does not (i.e., it was deleted).
op->map_dne_bound = osdmap->get_epoch();
ldout(cct, 10) << "check_op_pool_dne tid " << op->tid
<< " pool previously exists but now does not"
<< dendl;
} else {
ldout(cct, 10) << "check_op_pool_dne tid " << op->tid
<< " current " << osdmap->get_epoch()
<< " map_dne_bound " << op->map_dne_bound
<< dendl;
}
if (op->map_dne_bound > 0) {
if (osdmap->get_epoch() >= op->map_dne_bound) {
// we had a new enough map
ldout(cct, 10) << "check_op_pool_dne tid " << op->tid
<< " concluding pool " << op->target.base_pgid.pool() << " dne"
<< dendl;
<< " concluding pool " << op->target.base_pgid.pool()
<< " dne" << dendl;
if (op->onack) {
op->onack->complete(-ENOENT);
}
@ -1367,10 +1376,17 @@ void Objecter::_check_linger_pool_dne(LingerOp *op, bool *need_unregister)
*need_unregister = false;
ldout(cct, 10) << "_check_linger_pool_dne linger_id " << op->linger_id
<< " current " << osdmap->get_epoch()
<< " map_dne_bound " << op->map_dne_bound
<< dendl;
if (op->register_gen > 0) {
ldout(cct, 10) << "_check_linger_pool_dne linger_id " << op->linger_id
<< " pool previously existed but now does not"
<< dendl;
op->map_dne_bound = osdmap->get_epoch();
} else {
ldout(cct, 10) << "_check_linger_pool_dne linger_id " << op->linger_id
<< " current " << osdmap->get_epoch()
<< " map_dne_bound " << op->map_dne_bound
<< dendl;
}
if (op->map_dne_bound > 0) {
if (osdmap->get_epoch() >= op->map_dne_bound) {
if (op->on_reg_ack) {

View File

@ -1552,7 +1552,9 @@ public:
}
private:
~LingerOp() {}
~LingerOp() {
delete watch_context;
}
};
struct C_Linger_Register : public Context {

View File

@ -201,10 +201,7 @@ class RGWCache : public T
}
int distribute_cache(const string& normal_name, rgw_obj& obj, ObjectCacheInfo& obj_info, int op);
int watch_cb(uint64_t notify_id,
uint64_t cookie,
uint64_t notifier_id,
bufferlist& bl);
int watch_cb(int opcode, uint64_t ver, bufferlist& bl);
public:
RGWCache() {}
@ -560,10 +557,7 @@ int RGWCache<T>::distribute_cache(const string& normal_name, rgw_obj& obj, Objec
}
template <class T>
int RGWCache<T>::watch_cb(uint64_t notify_id,
uint64_t cookie,
uint64_t notifier_id,
bufferlist& bl)
int RGWCache<T>::watch_cb(int opcode, uint64_t ver, bufferlist& bl)
{
RGWCacheNotifyInfo info;

View File

@ -1215,23 +1215,13 @@ int RGWPutObjProcessor_Atomic::do_complete(string& etag, time_t *mtime, time_t s
return r;
}
class RGWWatcher : public librados::WatchCtx2 {
class RGWWatcher : public librados::WatchCtx {
RGWRados *rados;
public:
RGWWatcher(RGWRados *r) : rados(r) {}
void handle_notify(uint64_t notify_id,
uint64_t cookie,
uint64_t notifier_id,
bufferlist& bl) {
ldout(rados->ctx(), 10) << "RGWWatcher::handle_notify() "
<< " notify_id " << notify_id
<< " cookie " << cookie
<< " notifier " << notifier_id
<< " bl.length()=" << bl.length() << dendl;
rados->watch_cb(notify_id, cookie, notifier_id, bl);
}
void handle_error(uint64_t cookie, int err) {
// FIXME
void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) {
ldout(rados->ctx(), 10) << "RGWWatcher::notify() opcode=" << (int)opcode << " ver=" << ver << " bl.length()=" << bl.length() << dendl;
rados->watch_cb(opcode, ver, bl);
}
};
@ -1482,7 +1472,7 @@ void RGWRados::finalize_watch()
if (notify_oid.empty())
continue;
uint64_t watch_handle = watch_handles[i];
control_pool_ctx.unwatch2(watch_handle);
control_pool_ctx.unwatch(notify_oid, watch_handle);
RGWWatcher *watcher = watchers[i];
delete watcher;
@ -1617,7 +1607,7 @@ int RGWRados::init_watch()
RGWWatcher *watcher = new RGWWatcher(this);
watchers[i] = watcher;
r = control_pool_ctx.watch2(notify_oid, &watch_handles[i], watcher);
r = control_pool_ctx.watch(notify_oid, 0, &watch_handles[i], watcher);
if (r < 0)
return r;
}
@ -5890,7 +5880,7 @@ int RGWRados::distribute(const string& key, bufferlist& bl)
pick_control_oid(key, notify_oid);
ldout(cct, 10) << "distributing notification oid=" << notify_oid << " bl.length()=" << bl.length() << dendl;
int r = control_pool_ctx.notify2(notify_oid, bl, 0, NULL);
int r = control_pool_ctx.notify(notify_oid, 0, bl);
return r;
}

View File

@ -1783,10 +1783,7 @@ public:
virtual int init_watch();
virtual void finalize_watch();
virtual int distribute(const string& key, bufferlist& bl);
virtual int watch_cb(uint64_t notify_id,
uint64_t cookie,
uint64_t notifier_id,
bufferlist& bl) { return 0; }
virtual int watch_cb(int opcode, uint64_t ver, bufferlist& bl) { return 0; }
void pick_control_oid(const string& key, string& notify_oid);
void *create_context(void *user_ctx) {