chihsuan opened a new pull request, #12051:
URL: https://github.com/apache/ozone/pull/12051

   ## What changes were proposed in this pull request?
   
   `OMTenantAssignUserAccessIdRequest` and `OMTenantCreateRequest` add table 
cache entries before a check that can fail on apply. A failed request writes 
nothing to the DB, but its cache entries stay visible until the flush, and a 
volume entry stays even after it. A later request can read them and persist 
them, e.g. a principal row that lists an accessId with no `tenantAccessIdTable` 
row, after which every assign of that user fails with `INVALID_ACCESS_ID`.
   
   This PR moves the S3SecretTable check in assign and the `tenantStateTable` 
check in create ahead of all cache writes. Successful requests are unchanged. A 
create that hits both `TENANT_ALREADY_EXISTS` and `USER_TOO_MANY_VOLUMES` now 
reports the former, and its audit entry no longer carries the volume fields. 
Dangling accessIds already in the DB are not cleaned up.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17197
   
   ## How was this patch tested?
   
   New unit tests, which fail without the change:
   
   - 
`TestOMTenantAssignUserAccessIdRequest#testFailedAssignLeavesNoTableCacheEntries`
   - `TestOMTenantCreateRequest#testValidateAndUpdateCacheWhenTenantExists`
   - 
`TestOMTenantCreateRequest#testForceCreateWhenTenantExistsKeepsVolumeRefCount`
   
   `TestOMTenantCreateRequest#testVolumeExistsTakesPrecedenceOverTenantExists` 
pins the existing error order.
   
   CI: https://github.com/chihsuan/ozone/actions/runs/43673265749
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to