]> 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)
committerSage Weil <sage@redhat.com>
Tue, 8 Aug 2017 20:04:42 +0000 (16:04 -0400)
commit1f8f58becf1ec53c729b0befeb1f19c601588c4a
tree30f337a9bce792d6b7ac014d7cdcd088b47f7c10
parentd83e1dd79e877955a13b08ffa36ddc9888faa1cb
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>
src/common/LogClient.cc