From: Sage Weil Date: Tue, 30 Mar 2010 17:30:02 +0000 (-0700) Subject: mds: fix MDSTableClient ack double journaling X-Git-Tag: v0.20~151^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=58ce32cc84a82619108bf3496e0175b221b9e9a2;p=ceph.git mds: fix MDSTableClient ack double journaling Do not journal ack unless the tid is registered in the LogSegment. Once we journal it, we remove it from the LogSegment list, and once it's journaled, we remove the pending_commit[tid] entry. This fixes a bug where the mds got two acks, journaled both of them, and crashed in the completion for the second because pending_commit[tid] was gone. The second ack should have been ignored. --- diff --git a/src/mds/MDSTableClient.cc b/src/mds/MDSTableClient.cc index 513b79014635..05c7944f4d1b 100644 --- a/src/mds/MDSTableClient.cc +++ b/src/mds/MDSTableClient.cc @@ -85,7 +85,8 @@ void MDSTableClient::handle_request(class MMDSTableRequest *m) break; case TABLESERVER_OP_ACK: - if (pending_commit.count(tid)) { + if (pending_commit.count(tid) && + pending_commit[tid]->pending_commit_tids[table].count(tid)) { dout(10) << "got ack on tid " << tid << ", logging" << dendl; assert(g_conf.mds_kill_mdstable_at != 7); @@ -175,9 +176,10 @@ void MDSTableClient::got_journaled_agree(version_t tid, LogSegment *ls) void MDSTableClient::got_journaled_ack(version_t tid) { dout(10) << "got_journaled_ack " << tid << dendl; - if (pending_commit.count(tid)) + if (pending_commit.count(tid)) { pending_commit[tid]->pending_commit_tids[table].erase(tid); - pending_commit.erase(tid); + pending_commit.erase(tid); + } } void MDSTableClient::finish_recovery()