youngkermit8-coder opened a new issue, #2382:
URL: https://github.com/apache/rocketmq-dashboard/issues/2382

   ### Description
   
   `NameserverRegistryService` rejects duplicate registry names with a 
`selectCount` precheck, but `rmq_nameserver.name` has no unique constraint. Two 
concurrent creates can both observe zero rows and insert the same name. 
Concurrent updates can likewise rename different rows to the same name.
   
   This breaks the service's name-uniqueness invariant and leaves ambiguous 
registry entries. If a unique index is added without service handling, the 
losing request instead exposes an unhandled `DuplicateKeyException` as HTTP 500.
   
   ### Expected behavior
   
   The database should enforce NameServer registry name uniqueness across 
application instances. Both precheck-detected duplicates and database-detected 
concurrent conflicts should return a stable HTTP 409 response for create and 
update operations.
   
   ### Proposed fix
   
   - add a unique key on `rmq_nameserver.name`
   - map `DuplicateKeyException` from insert and update to the existing 
duplicate-name business error with code 409
   - add regressions for concurrent create and rename losers
   


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