qqeasonchen opened a new pull request, #5307: URL: https://github.com/apache/eventmesh/pull/5307
## Motivation This PR closes the remaining Phase 1 reliability gaps identified in the architecture audit (#5296). The `lite-topic` / `EventMeshFrame` architecture landed in 0be4e83 already covers #5288, #5294 (mq cursor recording) and #5295 (deferred broker ACK via `ackPulledMessage` + `mqAckCallback`); this change fixes the four issues that remained open. ## Changes ### #5289 — Offset writes were not atomic (regression window) `RocksDBOffsetStore.writeOffset` now performs its read-compare-put under a write lock, so a concurrently arriving ACK carrying a lower offset can no longer regress the stored offset between the read and the put. ### #5290 — Deliveries retired even when offset persistence failed `OffsetStore.writeOffset` now returns `boolean`. `ReliableDispatcher.ack()` only retires a delivery after the durable offset write succeeds; on failure the delivery stays in flight with backoff and redelivery, instead of being silently dropped. `InMemoryOffsetStore` keeps monotonicity via `AtomicLong.accumulateAndGet(offset, Math::max)`; `MetaBackedOffsetStore` propagates the local store's result. ### #5291 — Delivery IDs reused across restarts / instances Delivery IDs now embed the process boot epoch and a per-process random salt (`bootEpoch + instanceSalt + seq`), so a stale ACK arriving after a restart can never alias a fresh delivery. ### #5292 — DLQ writes were fire-and-forget (silent loss) `DeadLetterSink.deadLetter` now returns `CompletableFuture<Boolean>`. `ReliableDispatcher.tick()` retires a dead-lettered delivery only after storage confirms the DLQ write; otherwise the delivery returns to pending and the dead-letter transition is retried. `UniIngressService` completes the future from the storage send callback. ## Documentation - Does this PR introduce a new feature? No, reliability bug fixes only. ## Test Plan - Updated `ReliableDispatcherTest`, `DeferredAckDispatcherTest`, `DeliveryVolatileAndResurrectTest`, `MqCursorRecordingTest` for the new `DeadLetterSink` signature. - Full `eventmesh-runtime` test suite: **162 tests, all green**. - CI green on ubuntu-latest + macOS-latest (JDK 21): https://github.com/qqeasonchen/eventmesh/actions/runs/32206684906 Closes #5289 Closes #5290 Closes #5291 Closes #5292 Refs #5296 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
