]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: fix the serialization of notify_reply_t. 39840/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 4 Mar 2021 18:13:52 +0000 (18:13 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 4 Mar 2021 18:23:56 +0000 (18:23 +0000)
The `LibRadosWatchNotify.WatchNotify2` was expecting
data in the very raw form:

```cpp
  std::map<std::pair<uint64_t,uint64_t>, bufferlist> reply_map;
  std::set<std::pair<uint64_t,uint64_t> > missed_map;
  auto reply_p = reply.cbegin();
  decode(reply_map, reply_p);
  decode(missed_map, reply_p);
```

while the serialization of `notify_reply_t` was appending
extra preamable with versioning data.

This was the root cause of the following problem:
```
2021-03-04T15:40:03.001 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: Running main() from gmock_main.cc
2021-03-04T15:40:03.001 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [==========] Running 11 tests from 2 test suites.
2021-03-04T15:40:03.002 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [----------] Global test environment set-up.
2021-03-04T15:40:03.002 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [----------] 10 tests from LibRadosWatchNotify
2021-03-04T15:40:03.002 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [ RUN      ] LibRadosWatchNotify.WatchNotify
2021-03-04T15:40:03.002 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: watch_notify_test_cb
2021-03-04T15:40:03.003 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [       OK ] LibRadosWatchNotify.WatchNotify (744 ms)
2021-03-04T15:40:03.003 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [ RUN      ] LibRadosWatchNotify.Watch2Delete
2021-03-04T15:40:03.003 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: waiting up to 300 for disconnect notification ...
2021-03-04T15:40:03.003 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: watch_notify2_test_errcb cookie 94023196839536 err -107
2021-03-04T15:40:03.004 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [       OK ] LibRadosWatchNotify.Watch2Delete (3123 ms)
2021-03-04T15:40:03.004 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [ RUN      ] LibRadosWatchNotify.AioWatchDelete
2021-03-04T15:40:03.004 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: waiting up to 300 for disconnect notification ...
2021-03-04T15:40:03.004 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: watch_notify2_test_errcb cookie 94023196851488 err -107
2021-03-04T15:40:03.005 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [       OK ] LibRadosWatchNotify.AioWatchDelete (5086 ms)
2021-03-04T15:40:03.005 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: [ RUN      ] LibRadosWatchNotify.WatchNotify2
2021-03-04T15:40:03.005 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: watch_notify2_test_cb from 4394 notify_id 120259084288 cookie 94023196869248
2021-03-04T15:40:03.005 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: unknown file: Failure
2021-03-04T15:40:03.006 INFO:tasks.workunit.client.0.smithi058.stdout:         api_watch_notify: C++ exception with description "End of buffer" thrown in the test body.```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/watch.h

index 7a18e59c41022d4884d526248f16b697f4f78bc4..cdfb5b951443d58d22920b7972fb220ac257aaee 100644 (file)
@@ -100,11 +100,10 @@ struct notify_reply_t {
 
   bool operator<(const notify_reply_t& rhs) const;
   DENC(notify_reply_t, v, p) {
-    DENC_START(1, 1, p);
+    // there is no versioning / preamble
     denc(v.watcher_gid, p);
     denc(v.watcher_cookie, p);
     denc(v.bl, p);
-    DENC_FINISH(p);
   }
 };
 std::ostream &operator<<(std::ostream &out, const notify_reply_t &rhs);