feat: fence scheduler next-due updates (AEG-V15-036)

Adds dispatch revision CAS to dispatched, skip, and release schedule mutations. Targeted Release evidence: 8/8 passed. PostgreSQL concurrency rehearsal remains required; WBS stays IN_PROGRESS.
This commit is contained in:
2026-08-09 02:06:37 +09:00
parent d18f6a7a67
commit 5a1570790c
8 changed files with 144 additions and 11 deletions
@@ -17,6 +17,7 @@ public sealed record DueModelOperation(
string Queue,
string IdempotencyKey,
int ScheduleVersion,
int DispatchRevision,
DateTimeOffset ScheduledFor,
string CatchUpPolicy,
int MaxCatchUp);
@@ -52,6 +53,7 @@ public interface IModelScheduleRepository
Task MarkDispatchedAsync(
Guid scheduleId,
string leaseOwner,
int expectedDispatchRevision,
string backgroundJobId,
DateTimeOffset dispatchedAt,
DateTimeOffset nextDueAt,
@@ -60,6 +62,7 @@ public interface IModelScheduleRepository
Task AdvanceWithoutDispatchAsync(
Guid scheduleId,
string leaseOwner,
int expectedDispatchRevision,
DateTimeOffset advancedAt,
DateTimeOffset nextDueAt,
CancellationToken cancellationToken);
@@ -67,6 +70,7 @@ public interface IModelScheduleRepository
Task ReleaseAsync(
Guid scheduleId,
string leaseOwner,
int expectedDispatchRevision,
string reasonCode,
DateTimeOffset releasedAt,
CancellationToken cancellationToken);