coder999o opened a new pull request, #7350: URL: https://github.com/apache/rocketmq-dashboard/pull/7350
## What is the purpose of the change Fixes #7349. An instance update copies its metadata before acquiring the ownership lock. If a concurrent remark edit commits in between, the older update can pass the connection checks and save its old remark even when its request omitted that field. Reject that stale update with 409 before saving; a retry from a fresh snapshot preserves the committed remark. ## Brief changelog - Check the current remark with a locking read after the existing instance lock, so MySQL REPEATABLE READ does not reuse the earlier snapshot. - Keep the additional check in the instance-update path; resource writes still accept snapshots whose connection identity is unchanged. - Add six regression/control cases using the real service, MyBatis repository/mapper and H2 transactions, including remark edits and clearing, a fresh retry, unchanged null remarks and resource-write compatibility. No API or schema changes are required. Each instance update adds one scalar database read while holding the existing row lock. ## Verifying this change - Before the fix, the six new cases produced four expected failures: three lost-remark interleavings and the missing-conflict retry case. The null and resource-write controls passed. - `cd server && mvn -B -ntp -Dtest=InstanceUpdateConcurrencyTest,ResourceOwnershipGuardTest,InstanceServiceTest,MybatisPlusInstanceRepositoryTest test` — 158 tests passed, no failures/errors/skips; compilation and Checkstyle passed with zero violations. - `git diff --check` — passed. The interleaving is deterministic: a second service transaction commits after the first request reads its snapshot and before it acquires the guard lock. H2/MyBatis verification does not establish deployed MySQL or broker behavior; the full backend suite was not run. -- 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]
