]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/LogClient: assign seq and queue atomically
authorSage Weil <sage@redhat.com>
Fri, 4 Aug 2017 17:58:17 +0000 (13:58 -0400)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 23 Aug 2017 13:46:44 +0000 (15:46 +0200)
commite3dabe22f8b0b9bd2eddeb94636b201f92e745d2
tree6c5b90393dc69950d0e8da846dcb46be61a8e389
parentc4e37e01b4eefc50609b2d2f409cd92137c3423c
common/LogClient: assign seq and queue atomically

The _get_mon_log_message() assumes that log_last and log_queue
are in sync, but it was previously possible to increment log_last
setting e.seq in do_log(), and only later queue it.  If a racing
thread ran get_mon_log_message() in the meantime it would fail
an assertion.

Fix by assigning the seq and queueing it atomically.  If the
cluster log is not enabled, use the get_next_seq() helper so that
graylog or syslog messages still have a seq assigned.

Fixes: http://tracker.ceph.com/issues/18209
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 1f8f58becf1ec53c729b0befeb1f19c601588c4a)
src/common/LogClient.cc