]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: make sure to update history.last_epoch_started with first write
authorSamuel Just <sjust@redhat.com>
Wed, 18 Mar 2015 18:19:09 +0000 (11:19 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 18 Mar 2015 18:19:49 +0000 (11:19 -0700)
Otherwise, we might remember the write, but not that the activation
interval was history.last_epoch_started.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc

index ee3903aafc87696c6dbb9b234fef9ff9509fede6..cf72a86c41ce4b6e1f74b743b243454c19310ba7 100644 (file)
@@ -2911,6 +2911,15 @@ void PG::append_log(
 {
   if (transaction_applied)
     update_snap_map(logv, t);
+
+  /* The primary has sent an info updating the history, but it may not
+   * have arrived yet.  We want to make sure that we cannot remember this
+   * write without remembering that it happened in an interval which went
+   * active in epoch history.last_epoch_started.
+   */
+  if (info.last_epoch_started != info.history.last_epoch_started) {
+    info.history.last_epoch_started = info.last_epoch_started;
+  }
   dout(10) << "append_log " << pg_log.get_log() << " " << logv << dendl;
 
   map<string,bufferlist> keys;