yyqdbngt opened a new pull request, #2935: URL: https://github.com/apache/rocketmq-dashboard/pull/2935
## Summary `MybatisPlusK8sCertRepository.save()` decided insert-vs-update with `id != null && selectById(id) != null`. When the id was set but the row had disappeared in the meantime (a concurrent `deleteCert` between the service's `findById` and the save), the expression fell through to the insert branch and re-inserted the deleted certificate under its old id, resurrecting it. The update path now splits the two cases: an id that no longer resolves to a row is reported as a 404 concurrent removal, so a renew/update racing a delete fails closed instead of reviving the row. The existing 409 for a lost `updateById` is unchanged. ## Why `renewCert`/`updateCert` read the cert, mutate a copy, and save it. Without the guard, a delete that lands in that window silently recreates the certificate with its old primary key, leaving a "deleted" cert visible in `listCerts` and the audit trail pointing at a row that was supposed to be gone. ## Testing ``` cd server && mvn -Dtest="MybatisPlusK8sCertRepositoryTest" test ``` Tests run: 8, Failures: 0, Errors: 0, Skipped: 0 New regression test `saveShouldReportConcurrentRemovalInsteadOfResurrecting` asserts the 404 and that `insert` is never called when the id is missing. -- 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]
