fmorg-git opened a new pull request, #12011:
URL: https://github.com/apache/ozone/pull/12011

   Please describe your PR in detail:
   * S3RevokeSTSTokenRequest.preExecute stamps revocationTimeMillis with the 
current time of the OM that runs it, before the request is submitted to Ratis. 
On apply, S3RevokeSTSTokenRequest.validateAndUpdateCache puts that value into 
the s3RevokedStsTokenTable cache and S3RevokeSTSTokenResponse.addToDBBatch 
writes it to the DB, both without reading the cutoff already stored for the 
originalAccessKeyId.
   
   Nothing orders the stamp with the log position of the request: 
OMExecutionFlow.submitExecutionToRatis runs preExecute and the Ratis submit 
without a lock, and the stamps come from whichever OM runs preExecute. So the 
stamps of two revokes for the same key do not necessarily increase in log 
order, and when a revoke whose stamp is lower than the stored cutoff is 
applied, every OM replaces the stored cutoff with the lower value.
   
   Trigger
   A revoke for an originalAccessKeyId is applied while the cutoff stored for 
that key is higher than the revoke's stamp. This is the case when the revoke 
was stamped before an earlier applied revoke for the same key was stamped 
(stamp and apply are not ordered), or when it was stamped by an OM whose clock 
is behind the clock that stamped the stored cutoff.
   
   Impact
   After the apply, the stored cutoff for the key is the lower stamp on every 
OM, in the cache and in the DB, and it stays there when the table is loaded 
from the DB. Only a later revoke with a higher stamp raises it; 
RevokedSTSTokenCleanupService only deletes entries.
   S3SecurityUtil.isRevokedStsToken compares a token's signed creationTime with 
this stored value only. For tokens created between the lower stamp and the 
higher one, its result follows the lower cutoff, although the revoke that set 
the higher cutoff had been applied, until they expire.
   No data is lost or changed. STS is not part of a released Ozone version.
   Reproduction
   The regression test in the attached patch covers it and fails on unmodified 
source: TestS3RevokeSTSTokenRequest.testRevokeWithLowerStampKeepsStoredCutoff 
(hadoop-ozone/ozone-manager) applies revokes stamped 11000, 10000 and 12000 for 
one key through the real request and response on a real OmMetadataManagerImpl, 
commits each response, and checks the cache and the DB. Without the change it 
fails with expected: 11000L but was: 10000L after the second revoke.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-17408
   
   ## How was this patch tested?
   unit tests, ci workflows
   


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