unbridled-41 opened a new pull request, #5914:
URL: https://github.com/apache/rocketmq-dashboard/pull/5914
### Which Issue(s) This PR Fixes
Fixes #5913
### Problem / Evidence
Every instant of a delivery row comes from the service's UTC clock and the
console reads it as UTC, but the two bookkeeping columns were filled by the
database:
```java
// NotificationOutboxService: every Java-written instant
private static LocalDateTime utcNow() { return
LocalDateTime.now(ZoneOffset.UTC); }
// entity: no gmtCreate field; no update path names gmt_modified
// schema.sql:402-403: DEFAULT CURRENT_TIMESTAMP / ON UPDATE
CURRENT_TIMESTAMP
```
`deploy/docker-compose.yml` runs the database (and the server) with
`TZ=Asia/Shanghai`, so `gmt_create`/`gmt_modified` hold the session-zone wall
clock while everything around them is UTC. Consequences on that deployment:
创建时间 on the Alert Deliveries page and in its drawer is eight hours ahead (a
delivery can print earlier than its own creation), the page's time-range filter
sends UTC bounds against a server-local column, and `deleteTerminalBefore`'s
UTC cutoff keeps terminal rows eight hours longer than
`studio.alerting.notification-retention` says.
Observed before the fix (JVM default zone Asia/Shanghai):
```
NotificationOutboxServiceTest#enqueueStampsBothBookkeepingColumnsInUtcTest
FAIL (no UTC instant captured)
NotificationOutboxServiceTest#retryingAFailedDeliveryStampsTheModifiedInstantTest
FAIL (SET clause lacks gmt_modified)
```
### Root cause / Fix
The entity could not carry `gmt_create` and no update path named
`gmt_modified`, so both fell through to the column defaults. Add the field,
stamp both from `utcNow()` on insert, and add `gmt_modified` to every update:
the failed-retry release, the delivered transition, the silence deferral, the
retry backoff, plus `claimForDispatch` and `renewClaim`, whose SQL is in the
mapper.
### Priority and scoring
**PRIORITY 72** — impact 26/40 (a wrong time on the delivery audit page, a
filter that selects the wrong window, and a retention window off by the
offset), blast radius 16/20 (every deployment whose database zone is not UTC,
i.e. the shipped compose default), reproducibility 18/20 (deterministic, pinned
by tests with a non-UTC JVM zone), maintenance value 12/20.
**FIX_CONFIDENCE 92** — the intent (UTC) is explicit in the same class; the
fix is a passthrough on six write paths.
### Tests
`cd server && mvn -o -B -ntp test
-Dtest='org.apache.rocketmq.studio.ops.alert.**'` -> `Tests run: 328, Failures:
0, Errors: 0`; `mvn -o -B -ntp checkstyle:check` passes.
| Test | Before | After |
|---|---|---|
|
`NotificationOutboxServiceTest#enqueueStampsBothBookkeepingColumnsInUtcTest` |
FAIL | PASS |
|
`NotificationOutboxServiceTest#retryingAFailedDeliveryStampsTheModifiedInstantTest`
| FAIL | PASS |
### Risk
Rows written before this change keep their old values until they are next
updated; the retention cutoff treats those rows exactly as it does today. No
API shape changes.
### Dedupe note
An earlier PR with this fix (#4949, issue #4964) was closed by the stale bot
after seven days without activity, not on technical grounds, and its branch
predates the delivery time filter that landed afterwards. This branch is
rebased on the current trunk and keeps that filter.
--
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]