alerting(eval): atomic per-rule batch commit via @Transactional — Phase 2 close
Wraps instance writes, notification enqueues, and cursor advance in one transactional boundary per rule tick. Rollback leaves the rule replayable on next tick. Turns the Phase 2 atomicity IT green (see AlertEvaluatorJobIT #tickRollback_faultOnSecondNotificationInsert_leavesCursorUnchanged).
This commit is contained in:
@@ -28,7 +28,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
@@ -441,6 +440,7 @@ class AlertEvaluatorJobIT extends AbstractPostgresIT {
|
||||
} catch (RuntimeException expectedAfterPhase2) {
|
||||
// Phase 2 may choose to rethrow; either way the rollback assertions
|
||||
// below are what pin the contract.
|
||||
// intentionally empty — fault-injection swallow/rethrow tolerance; see comment above
|
||||
}
|
||||
|
||||
// Post-rollback: zero instances, zero notifications, cursor unchanged,
|
||||
|
||||
Reference in New Issue
Block a user