]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle dup anchorclient ACKs gracefully
authorSage Weil <sage@newdream.net>
Thu, 10 Jun 2010 05:17:22 +0000 (22:17 -0700)
committerSage Weil <sage@newdream.net>
Thu, 10 Jun 2010 05:17:22 +0000 (22:17 -0700)
One recovery scenario sees crisscrossing 'agree' and 'commit':

 C->S --> commit1
 S->C --> agree

 C<-S <== agree
  C->S --> commit2   .. client resends commit!

 S<-C <== commit1
  S->C --> ack      .. server resends ack!
 S<-C <== commit2
  S->C --> ack      .. server resends ack!

 C<-S <== commit1
  client journals ack
 C<-S <== commit2
  client should ignore dup ack  ***

*** but doesn't, because the 'remove from committing list' bit above was
never in the code, even as far back as v0.4 (just the comment).  Instead,
the map was getting fixed up in the _logged_ack() completion.  Move it
up here instead, where it belongs!

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/MDSTableClient.cc

index 0a4c60f8f3e9e3fdd546033acfb4bdbdaf5f9446..6f87a0eccf694aadbdfd81e4ebde14d80cf62aef 100644 (file)
@@ -92,8 +92,9 @@ void MDSTableClient::handle_request(class MMDSTableRequest *m)
       assert(g_conf.mds_kill_mdstable_at != 7);
       
       // remove from committing list
-      assert(pending_commit[tid]->pending_commit_tids[table].count(tid));
-      
+      pending_commit[tid]->pending_commit_tids[table].erase(tid);
+      pending_commit.erase(tid);
+
       // log ACK.
       mds->mdlog->start_submit_entry(new ETableClient(table, TABLESERVER_OP_ACK, tid),
                                     new C_LoggedAck(this, tid));
@@ -116,12 +117,6 @@ void MDSTableClient::_logged_ack(version_t tid)
 
   assert(g_conf.mds_kill_mdstable_at != 8);
 
-  assert(pending_commit.count(tid));
-  assert(pending_commit[tid]->pending_commit_tids[table].count(tid));
-  
-  pending_commit[tid]->pending_commit_tids[table].erase(tid);
-  pending_commit.erase(tid);
-  
   // kick any waiters (LogSegment trim)
   if (ack_waiters.count(tid)) {
     dout(15) << "kicking ack waiters on tid " << tid << dendl;