From 0b79eba1c0525071323e49918687a9804b33bdfe Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 4 Mar 2021 18:13:52 +0000 Subject: [PATCH] crimson/osd: fix the serialization of notify_reply_t. The `LibRadosWatchNotify.WatchNotify2` was expecting data in the very raw form: ```cpp std::map, bufferlist> reply_map; std::set > 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 --- src/crimson/osd/watch.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crimson/osd/watch.h b/src/crimson/osd/watch.h index 7a18e59c410..cdfb5b95144 100644 --- a/src/crimson/osd/watch.h +++ b/src/crimson/osd/watch.h @@ -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); -- 2.39.5