]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: fix journal-less operation
authorSage Weil <sage@inktank.com>
Sat, 19 Apr 2014 15:26:54 +0000 (08:26 -0700)
committerSage Weil <sage@inktank.com>
Fri, 23 May 2014 18:47:16 +0000 (11:47 -0700)
A few different fixes here:

- make the op_seq correct on start when there is no replay
- make an explicit 'no journal' case in queue_transaction (one that
  actually works).  Note that the 'trailing journal' mode is probably
  still broken.
- add a -J flag to vstart.sh for journalless operation

Signed-off-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc
src/os/JournalingObjectStore.cc
src/vstart.sh

index c0db0b202bb42d8da3697002b6c2900eff2256f6..cd895199f2f4bdb99bd342c7dcccf14d6033a535 100644 (file)
@@ -1420,6 +1420,8 @@ int FileStore::mount()
     }
     if (m_filestore_journal_writeahead)
       journal->set_wait_on_full(true);
+  } else {
+    dout(0) << "mount: no journal" << dendl;
   }
 
   ret = _sanity_check_fs();
@@ -1801,6 +1803,26 @@ int FileStore::queue_transactions(Sequencer *posr, list<Transaction*> &tls,
     return 0;
   }
 
+  if (!journal) {
+    Op *o = build_op(tls, onreadable, onreadable_sync, osd_op);
+    dout(5) << __func__ << " (no journal) " << o << " " << tls << dendl;
+
+    op_queue_reserve_throttle(o, handle);
+
+    uint64_t op_num = submit_manager.op_submit_start();
+    o->op = op_num;
+
+    if (m_filestore_do_dump)
+      dump_transactions(o->tls, o->op, osr);
+
+    queue_op(osr, o);
+
+    if (ondisk)
+      apply_manager.add_waiter(op_num, ondisk);
+    submit_manager.op_submit_finish(op_num);
+    return 0;
+  }
+
   uint64_t op = submit_manager.op_submit_start();
   dout(5) << "queue_transactions (trailing journal) " << op << " " << tls << dendl;
 
index 7616fe238b5305212c7f69b736509ebc58f11122..490a014c5d182a3604d47627b6ce3b21004a2728 100644 (file)
@@ -43,8 +43,10 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
   uint64_t op_seq = fs_op_seq;
   apply_manager.init_seq(fs_op_seq);
 
-  if (!journal)
+  if (!journal) {
+    submit_manager.set_op_seq(op_seq);
     return 0;
+  }
 
   int err = journal->open(op_seq);
   if (err < 0) {
index 6ca391cc711a410d03c06ac2a566d2e62639984e..c9a91ff7dce8a652d27a85b00d75580cdf844ba5 100755 (executable)
@@ -40,6 +40,7 @@ overwrite_conf=1
 cephx=1 #turn cephx on by default
 cache=""
 memstore=0
+journal=1
 
 MON_ADDR=""
 
@@ -66,6 +67,8 @@ usage=$usage"\t-x enable cephx (on by default)\n"
 usage=$usage"\t-X disable cephx\n"
 usage=$usage"\t--hitset <pool> <hit_set_type>: enable hitset tracking\n"
 usage=$usage"\t-o config\t\t add extra config parameters to mds section\n"
+usage=$usage"\t-J no journal\t\tdisable filestore journal\n"
+
 
 usage_exit() {
        printf "$usage"
@@ -143,6 +146,9 @@ case $1 in
     -X )
            cephx=0
            ;;
+    -J )
+           journal=0
+           ;;
     -k )
            overwrite_conf=0
            ;;
@@ -342,6 +348,11 @@ cat <<EOF >> $conf
        auth client required = none
 EOF
 fi
+                        if [ $journal -eq 1 ]; then
+                           journal_path="$CEPH_DEV_DIR/osd\$id.journal"
+                       else
+                           journal_path=""
+                       fi
                        cat <<EOF >> $conf
 
 [client]
@@ -360,7 +371,7 @@ $extra_conf
 [osd]
 $DAEMONOPTS
         osd data = $CEPH_DEV_DIR/osd\$id
-        osd journal = $CEPH_DEV_DIR/osd\$id.journal
+        osd journal = $journal_path
         osd journal size = 100
         osd class tmp = out
         osd class dir = .libs