]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: update missing_loc for async_recovery_targets
authorNeha Ojha <nojha@redhat.com>
Tue, 16 Jan 2018 18:09:16 +0000 (10:09 -0800)
committerNeha Ojha <nojha@redhat.com>
Wed, 14 Mar 2018 22:56:05 +0000 (15:56 -0700)
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/ECBackend.cc
src/osd/PrimaryLogPG.cc

index b679efe6b4b3638c17105139b8647edf01c7522c..f78e0a12a72dfd5ca5bb221dbf113213eea16433 100644 (file)
@@ -883,7 +883,6 @@ void ECBackend::handle_sub_write(
   if (msg)
     msg->mark_started();
   trace.event("handle_sub_write");
-  assert(!get_parent()->get_log().get_missing().is_missing(op.soid));
   if (!get_parent()->pgb_is_primary())
     get_parent()->update_stats(op.stats);
   ObjectStore::Transaction localt;
index 14a92f28fbfb57fa1e3e90432cd070eed10221fe..640cd6b7b3ec7d133f6f38ac345af2cf60f3a539 100644 (file)
@@ -10065,6 +10065,34 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
   for (auto &&entry: ctx->log) {
     projected_log.add(entry);
   }
+
+  for (set<pg_shard_t>::iterator i = async_recovery_targets.begin();
+       i != async_recovery_targets.end();
+       ++i) {
+    if (*i == get_primary() || !peer_missing[*i].is_missing(soid)) continue;
+    for (auto &&entry: ctx->log) {
+      peer_missing[*i].add_next_event(entry);
+    }
+  }
+
+  for (set<pg_shard_t>::const_iterator i = acting_recovery_backfill.begin();
+       i != acting_recovery_backfill.end();
+       ++i) {
+    pg_shard_t peer(*i);
+    if (peer == pg_whoami) continue;
+    if (async_recovery_targets.count(peer) && peer_missing[peer].is_missing(soid)) {
+      missing_loc.add_missing(soid, ctx->at_version, eversion_t());
+    }
+  }
+
+  for (set<pg_shard_t>::const_iterator i = actingset.begin();
+       i != actingset.end();
+       ++i) {
+    pg_shard_t peer(*i);
+    if (!peer_missing[peer].is_missing(soid))
+      missing_loc.add_location(soid, peer);
+  }
+
   pgbackend->submit_transaction(
     soid,
     ctx->delta_stats,
@@ -10078,15 +10106,6 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
     repop->rep_tid,
     ctx->reqid,
     ctx->op);
-
-  for (set<pg_shard_t>::iterator i = async_recovery_targets.begin();
-       i != async_recovery_targets.end();
-       ++i) {
-    if (*i == get_primary() || !peer_missing[*i].is_missing(soid)) continue;
-    for (auto &&entry: ctx->log) {
-      peer_missing[*i].add_next_event(entry);
-    }
-  }
 }
 
 PrimaryLogPG::RepGather *PrimaryLogPG::new_repop(