Kris20030907 opened a new pull request, #7048:
URL: https://github.com/apache/rocketmq-dashboard/pull/7048
Closes #7047
## Solution
`reportSpeed` now stamps `gmt_modified` from the same UTC clock as every
other
`rmq_ai_run` write, so the DDL's `ON UPDATE CURRENT_TIMESTAMP` never gets the
chance to rewrite it in the database session's timezone:
```java
RmqAiRun update = new RmqAiRun();
update.setId(run.getId());
update.setTokensPerSecond(tokensPerSecond);
update.setGmtModified(LocalDateTime.now(clock));
runRepository.update(update);
```
The update stays partial: `status`, `end_seq`, `finished_at` and the other
finalize-owned columns remain null and stay out of the SET clause, so the
race
#5196 fixed — a speed report landing after `finalizeRun` resurrecting a
terminal run — is untouched. Only the bookkeeping timestamp joins the speed
column, which is the treatment `rememberRuntimeSession` already applies.
The javadoc claim "Only the speed column is touched" described neither the
old
behavior nor the new one: the write always reached `gmt_modified` through the
DDL. It is corrected to say which columns are written and why.
A schema-level alternative — dropping `ON UPDATE CURRENT_TIMESTAMP` — was
considered and rejected: it needs a migration for existing installs, while
every other write site already stamps the column explicitly.
## Tests
-
`AiRunServiceTest.reportSpeedShouldStampGmtModifiedWithoutTouchingFinalizeColumnsTest`
(renamed from `reportSpeedShouldTouchOnlyTheSpeedColumnTest`): the update
now
carries `gmt_modified` equal to the service's fixed test clock and still
leaves every finalize-owned column null. The assertion is red before the
fix.
- `AiRunTestSupport.copyOf` now snapshots `gmtModified` too. The old
`getGmtModified()).isNull()` assertion was vacuously green: the capture
helper never copied the column, so the test could not see what the update
actually wrote.
## Verification
Full server suite: 3735 tests pass. Frontend suites: not affected
(server-only
change).
--
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]