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

   ## What changes were proposed in this pull request?
   Quota repair builds its baseline from a checkpoint of the active Ozone 
Manager (OM) database, then reads each snapshot database live to count pending 
deletes. A snapshot key purge can commit in the gap between those two steps. 
The purge removes the key from the snapshot database and drops the snapshot's 
contribution from snapshotUsedBytes. The old scan walked the live snapshot 
chain, so a snapshot removed after the checkpoint was skipped, and a snapshot 
whose database had already been purged was scanned as empty. Either way the 
repair subtracted bytes that were no longer in the bucket usage and could leave 
snapshotUsedBytes negative.
   
   The scan now lists snapshots from the checkpoint's snapshotInfo table, so a 
snapshot that has left the live chain since the checkpoint is still examined. 
After each snapshot database is read, the repair compares that snapshot's 
lastTransactionInfo in the checkpoint with the live entry. Every request that 
changes a snapshot database or removes the snapshot updates 
lastTransactionInfo, or deletes the entry when it is applied, so a missing or 
changed value means the scan did not see the snapshot as of the checkpoint. The 
repair then fails without submitting a repair request, and the operator can run 
it again.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-17241
   
   ## How was this patch tested?
   Unit tests in TestQuotaRepairTask:
   * A purge that commits after the checkpoint and before the snapshot scan 
fails the repair, submits no request, and leaves snapshot usage unchanged.
   * The same purge committed before the checkpoint lets the repair succeed and 
sets snapshot usage to zero.
   * A snapshot that leaves the chain after the checkpoint (pending key moved 
back to the active deletedTable, then the snapshot deleted) fails the repair 
and leaves snapshot usage unchanged.
   
   This change adapts a patch @smengcl provided through Specula


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