]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filejournal: journal_replay_from
authorSage Weil <sage@newdream.net>
Thu, 27 Oct 2011 16:47:20 +0000 (09:47 -0700)
committerSage Weil <sage@newdream.net>
Thu, 27 Oct 2011 16:50:29 +0000 (09:50 -0700)
Force journal replay from a point other than the op_seq recorded by the
fs.  This is useful if you want to skip bad entries in the journal (e.g.,
because they were non-idempotent and you know they were applied and the fs
operations were fully ordered).

Signed-off-by: Sage Weil <sage@newdream.net>
src/common/config_opts.h
src/os/JournalingObjectStore.cc

index ab526415982074a079a6544e4d528eefb333bfdf..29ab38f2147a73b749187f5e738bdf1b67f2f769 100644 (file)
@@ -317,6 +317,7 @@ OPTION(journal_max_write_entries, OPT_INT, 100)
 OPTION(journal_queue_max_ops, OPT_INT, 500)
 OPTION(journal_queue_max_bytes, OPT_INT, 100 << 20)
 OPTION(journal_align_min_size, OPT_INT, 64 << 10)  // align data payloads >= this.
+OPTION(journal_replay_from, OPT_INT, 0)
 OPTION(bdev_lock, OPT_BOOL, true)
 OPTION(bdev_iothreads, OPT_INT, 1)         // number of ios to queue with kernel
 OPTION(bdev_idle_kick_after_ms, OPT_INT, 100)  // ms
index 1dc42698ab57365cc69e1d2cabdad5b177446853..14120e6cd24d29a7904af9e117740d4d81b89302 100644 (file)
@@ -29,9 +29,17 @@ void JournalingObjectStore::journal_stop()
 int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
 {
   dout(10) << "journal_replay fs op_seq " << fs_op_seq << dendl;
+
+  if (g_conf->journal_replay_from) {
+    dout(0) << "journal_replay forcing replay from " << g_conf->journal_replay_from
+           << " instead of " << fs_op_seq << dendl;
+    // the previous op is the last one committed
+    fs_op_seq = g_conf->journal_replay_from - 1;
+  }
+
   op_seq = fs_op_seq;
   committed_seq = op_seq;
-       committing_seq = op_seq;
+  committing_seq = op_seq;
   applied_seq = fs_op_seq;
 
   if (!journal)