]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
st_rados_watch: tolerate extra notifies
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 11 Dec 2012 20:26:21 +0000 (12:26 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 11 Dec 2012 23:44:32 +0000 (15:44 -0800)
With retries, it's possible for notifies to be received more than once
when they are resent to different OSDs, since the OSDs only track them
in memory.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/test/system/st_rados_watch.cc

index d6647ded8dcee0795f69e5077cfca73583b9f9b4..991dde8ea77e9581f3f6cbb97b28554f95be3bb4 100644 (file)
@@ -73,10 +73,16 @@ run()
   m_notify_sem->wait();
   m_notify_sem->post();
 
-  RETURN1_IF_NOT_VAL(m_num_notifies, num_notifies);
+  int r = 0;
+  if (num_notifies < m_num_notifies) {
+    printf("Received fewer notifies than expected: %d < %d\n",
+          num_notifies, m_num_notifies);
+    r = 1;
+  }
+
   rados_unwatch(io_ctx, m_obj_name.c_str(), handle);
   rados_ioctx_destroy(io_ctx);
   rados_shutdown(cl);
 
-  return 0;
+  return r;
 }