forked from lei.chen/myxce
Upgrade apply_wal_entry() from P0 static no-op stub to the real public standby replay path: - Reject oversized payloads (> MAX_WAL_PAYLOAD_BYTES) with -EMSGSIZE - Skip WAL_CHECKPOINT (100) entries silently — local-only markers, never replicated to standbys; current_lsn is NOT advanced on skip - Skip unknown types (> WAL_ENTRY_TYPE_MAX) with WARN log and rc=0 for forward compatibility with WAL written by newer controller versions - Advance current_lsn to hdr->lsn+1 and update last_crc under p->lock for all accepted known entries - Gate restore_job()/worker_from_capnp() calls on p->cluster != NULL so unit tests work without a full cluster wired in - Add NULL guard returning -EINVAL for missing p or hdr Add public declaration in persist.h with forward-declare stubs for restore_job/worker_from_capnp in persist.c (avoids heavy cluster.h chain). Test suite: 5 new Unity tests in test_repl_apply.c covering all branches. Weak stubs for restore_job/worker_from_capnp in the test file satisfy the linker without linking job.c/worker.c's heavy dependency graph. All 5 new tests pass; full controller suite green. |
||
|---|---|---|
| .. | ||
| include | ||
| testsuite | ||
| apiserver.c | ||
| CLAUDE.md | ||
| cluster.c | ||
| dataex.c | ||
| ha.c | ||
| ha.h | ||
| job.c | ||
| join.c | ||
| main.c | ||
| meson.build | ||
| misc.c | ||
| myapp.c | ||
| myconf.c | ||
| opget.c | ||
| opupd.c | ||
| persist.c | ||
| queue.c | ||
| repl.c | ||
| repl.h | ||
| reply.c | ||
| resources.c | ||
| sched.c | ||
| task.c | ||
| worker.c | ||