yx9o opened a new pull request, #6884:
URL: https://github.com/apache/rocketmq-dashboard/pull/6884

   ### Brief Description
   
   Replacing a NameServer registry entry currently performs an `updateById` 
followed by a separate statement that clears omitted optional fields. If 
another replacement completes between those statements, the first request can 
clear the second request's namespace, K8s ID, or description, leaving a record 
that matches neither submitted replacement.
   
   Write the name, normalized address, and all three optional fields in one 
ID-scoped `UPDATE`, including explicit null values. Remove the separate 
clearing method. Preserve name/address validation, duplicate-name conflicts, 
affected-row checks, and the stored-row reload. No API or schema changes are 
required.
   
   Add an H2-backed regression using the real MyBatis mapper: another 
replacement completes after the first statement commits, and its complete 
record must survive. Also cover a replacement that mixes populated and cleared 
optional fields, and update the existing validation/error-path tests for the 
single-statement update.
   
   ### How Did You Test This Change?
   
   Using JDK 22.0.2 with the project's Java 21 compilation target:
   
   ```bash
   mvn -f server/pom.xml -B -ntp 
'-Dtest=NameserverRegistry*Test,NamesrvAddrParserTest,NameServer*Test' test
   git diff --check
   ```
   
   - 79 tests passed, with zero failures, errors, or skips. Maven compiled 
production and test sources, and Checkstyle reported zero violations.
   - Before the production fix, the two new persistence tests ran with one 
failure: the competing replacement's namespace was unexpectedly null. Both pass 
with the fix.
   - Independent source review found no actionable issues.
   
   The persistence regression uses deterministic statement interleaving against 
H2 in MySQL mode. The full backend suite and concurrent live MySQL requests 
were not run.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
— not applicable; no UI text changes
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) — full suite not run; the focused suite above passed
   - [x] New source files carry the ASF license header
   - [x] Documentation touched where behaviour changed — not applicable; the 
existing replacement contract is preserved
   


-- 
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]

Reply via email to