feat(ha-single-leader-role): WAL_NOOP entry type — enum + apply no-op + RETAIN classify (task 1.2)

This commit is contained in:
Rongsong Shen 2026-06-13 07:45:21 +00:00
parent 6df1283f1a
commit e6abd7c8af
3 changed files with 13 additions and 1 deletions

View file

@ -764,6 +764,12 @@ int apply_wal_entry(persist_t* p, const wal_entry_hdr_t* hdr, const void* payloa
}
break;
case WAL_NOOP:
/* Internal promotion no-op: empty payload, no entity restore, no
* hooks. The common-path current_lsn advance (above) is its only
* effect — recognised explicitly here rather than via default. */
break;
default:
break;
}
@ -1160,6 +1166,11 @@ wal_commit_mode_t wal_classify(uint32_t wal_type, int detail)
* realized by the handler barrier in do_jobcontrol_op
* (research.md §2 call-site verification). */
return WAL_MODE_RETAIN;
case WAL_NOOP:
/* internal promotion no-op — replicated like any committed entry,
* retained until committed (ha-commit-barrier-rollout pre-declared
* row: promotion | internal | RETAIN; guard forces classification) */
return WAL_MODE_RETAIN;
case WAL_CHECKPOINT:
/* local segment marker — never replicated, by design */
return WAL_MODE_LOCAL;

View file

@ -54,5 +54,6 @@ typedef enum {
WAL_JOB_PREASON = 10,
WAL_QUEUE_CTRL = 20,
WAL_WORKER_CTRL = 30,
WAL_NOOP = 40, /* Internal: empty payload, replay no-op; appended only at promotion */
WAL_CHECKPOINT = 100, /* Local WAL marker only — never replicated */
} wal_entry_type;