info.last_epoch_started <= activation_epoch);
info.last_epoch_started = activation_epoch;
info.last_interval_started = info.history.same_interval_since;
+
+ // updating last_epoch_started ensures that last_update will not
+ // become divergent after activation completes.
+ pg_committed_to = info.last_update;
}
} else if (is_acting(pg_whoami)) {
/* update last_epoch_started on acting replica to whatever the primary sent
auto &missing = pg_log.get_missing();
min_last_complete_ondisk = eversion_t(0,0); // we don't know (yet)!
- if (is_primary()) {
- pg_committed_to = info.last_update;
- }
last_update_applied = info.last_update;
last_rollback_info_trimmed_to_applied = pg_log.get_can_rollback_to();
/**
* pg_committed_to
*
- * Maintained on the primary while pg is at least peered.
+ * Maintained on the primary while pg is active (and not merely peered).
*
* Forall e <= pg_committed_to, e has been committed on all replicas.
*
- * As a consequence, if the pg is active (and not merely peered):
+ * As a consequence:
* - No version e <= pg_committed_to can become divergent
* - It is safe for replicas to read any object whose most recent update is
* <= pg_committed_to
*
- * Note that if the PG is only peered, it is in fact possible for
- * pg_committed_to to become divergent.
+ * Note that if the PG is only peered, pg_committed_to not be set
+ * and will remain eversion_t{} as we cannot guarantee that last_update
+ * at activation will not later become divergent.
*/
eversion_t pg_committed_to;