]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: fix race in op enqueuing to ensure throttle limit is honors
authorSage Weil <sage@newdream.net>
Thu, 12 Aug 2010 19:59:05 +0000 (12:59 -0700)
committerSage Weil <sage@newdream.net>
Thu, 12 Aug 2010 20:10:23 +0000 (13:10 -0700)
src/os/FileStore.cc
src/os/FileStore.h

index 22c53594d890571c7a7efa7c6b888ea820b1f38f..db420607e8ff49779107bc982413993831ee4edb 100644 (file)
@@ -798,9 +798,15 @@ void FileStore::queue_op(Sequencer *posr, uint64_t op_seq, list<Transaction*>& t
             << op_queue_bytes << " > " << g_conf.filestore_queue_max_bytes << dendl;
     op_tp.wait(op_throttle_cond);
   }
+
+  op_queue_len++;
+  op_queue_bytes += bytes;
+
   op_tp.unlock();
 
-  dout(10) << "queue_op " << o << " seq " << op_seq << " " << bytes << " bytes" << dendl;
+  dout(10) << "queue_op " << o << " seq " << op_seq << " " << bytes << " bytes"
+          << "   (queue has " << op_queue_len << " ops and " << op_queue_bytes << " bytes)"
+          << dendl;
   op_wq.queue(osr);
 }
 
index 469f4de49b99593a0fd5d7e7fc6665dd9f9a1c96..da244349e7f31d11ce3fb9693b4cb40f650a9637 100644 (file)
@@ -119,8 +119,6 @@ class FileStore : public JournalingObjectStore {
 
     bool _enqueue(OpSequencer *osr) {
       store->op_queue.push_back(osr);
-      store->op_queue_len++;
-      store->op_queue_bytes += osr->q.back()->bytes;
       return true;
     }
     void _dequeue(OpSequencer *o) {