return cct;
}
+ enum NonPrimary : bool {
+ NonPrimaryFalse = false,
+ NonPrimaryTrue = true
+ };
+
////////////////////////////// sub classes //////////////////////////////
struct LogEntryHandler {
virtual void rollback(
}
// actors
- void add(const pg_log_entry_t& e, bool applied = true) {
+ void add(const pg_log_entry_t& e, enum NonPrimary nonprimary, bool applied) {
if (!applied) {
- ceph_assert(get_can_rollback_to() == head);
+ if (!nonprimary) {
+ ceph_assert(get_can_rollback_to() == head);
+ } else {
+ ceph_assert(get_can_rollback_to() >= head);
+ }
}
// make sure our buffers don't pin bigger buffers
}
} // add
+ // nonprimary and applied must either both be provided or neither. If
+ // neither is provided applied = true and the nonprimary is irrelevant.
+ void add(const pg_log_entry_t& e) {
+ add(e, NonPrimaryFalse, true);
+ }
+
void trim(
CephContext* cct,
eversion_t s,
void unindex() { log.unindex(); }
- void add(const pg_log_entry_t& e, bool applied = true) {
+ void add(const pg_log_entry_t& e, enum NonPrimary nonprimary, bool applied) {
mark_writeout_from(e.version);
- log.add(e, applied);
+ log.add(e, nonprimary, applied);
+ }
+
+ void add(const pg_log_entry_t& e) {
+ add(e, NonPrimaryFalse, true);
}
void reset_recovery_pointers() { log.reset_recovery_pointers(); }
info.last_user_version = e.user_version;
// log mutation
- pg_log.add(e, applied);
+ enum PGLog::NonPrimary nonprimary{pool.info.is_nonprimary_shard(info.pgid.shard)};
+ pg_log.add(e, nonprimary, applied);
psdout(10) << "add_log_entry " << e << dendl;
}