int TestIoCtxImpl::watch(const std::string& o, uint64_t *handle,
librados::WatchCtx *ctx, librados::WatchCtx2 *ctx2) {
- return m_client->get_watch_notify().watch(o, handle, ctx, ctx2);
+ return m_client->get_watch_notify().watch(o, get_instance_id(), handle, ctx,
+ ctx2);
}
int TestIoCtxImpl::execute_aio_operations(const std::string& oid,
it != watcher->watch_handles.end(); ++it) {
obj_watch_t obj;
strcpy(obj.addr, ":/0");
- obj.watcher_id = static_cast<int64_t>(it->second.handle);
+ obj.watcher_id = static_cast<int64_t>(it->second.instance_id);
obj.cookie = it->second.handle;
obj.timeout_seconds = 30;
out_watchers->push_back(obj);
notify_handle->cond.Signal();
}
-int TestWatchNotify::watch(const std::string& o, uint64_t *handle,
- librados::WatchCtx *ctx, librados::WatchCtx2 *ctx2) {
+int TestWatchNotify::watch(const std::string& o, uint64_t instance_id,
+ uint64_t *handle, librados::WatchCtx *ctx,
+ librados::WatchCtx2 *ctx2) {
SharedWatcher watcher = get_watcher(o);
RWLock::WLocker l(watcher->lock);
WatchHandle watch_handle;
+ watch_handle.instance_id = instance_id;
watch_handle.handle = ++m_handle;
watch_handle.watch_ctx = ctx;
watch_handle.watch_ctx2 = ctx2;
typedef std::map<uint64_t, SharedNotifyHandle> NotifyHandles;
struct WatchHandle {
+ uint64_t instance_id;
uint64_t handle;
librados::WatchCtx* watch_ctx;
librados::WatchCtx2* watch_ctx2;
uint64_t timeout_ms, bufferlist *pbl);
void notify_ack(const std::string& o, uint64_t notify_id,
uint64_t handle, uint64_t gid, bufferlist& bl);
- int watch(const std::string& o, uint64_t *handle,
+ int watch(const std::string& o, uint64_t instance_id, uint64_t *handle,
librados::WatchCtx *ctx, librados::WatchCtx2 *ctx2);
int unwatch(uint64_t handle);