]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/Newstore: flush_commit return true on STATE_KV_DONE
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Wed, 29 Apr 2015 05:45:52 +0000 (13:45 +0800)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:41 +0000 (13:39 -0400)
commit36ed3dd20ad2e7922a2ec300036601ba03841d3f
tree09ef0fdf7ea5bf4e6e1d652eb247e03615622b90
parente02e7438578dc614d4cf8858164989970d36c4dc
os/Newstore: flush_commit return true on STATE_KV_DONE

There is a racing condition here, if the flush_commit() call
happened after _txc_finish_kv and before next state, the context
was pushed to on_commits but no one will handle the context since
we already pass _txc_finish_kv. This bug can be easily reproduce
by putting a sleep(5) after _txc_finish_kv, and trigger the bug by
ceph-osd -i 0 --mkfs.

Fix this bug by return true directly when state >= STATE_KV_DONE(instead
of > in previous code). We already persist the data in STATE_KV_DONE so
it's safe for us to do this.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/os/newstore/NewStore.h