jojochuang commented on PR #8999:
URL: https://github.com/apache/ozone/pull/8999#issuecomment-3250597271

   
   
   ### What does the PR do?
   **Current behavior:** When loading a snapshot in Ozone, the Snapshot Cache 
checks if the directory for the snapshot exists. That’s its main criterion to 
proceed.
   
   **Problem:** Just checking for the existence of the directory is not enough. 
Snapshots rely on metadata files that are created as part of the snapshot 
process, and these files are used for operations like snapshot diff. If the 
snapshot creation transaction hasn’t been completely flushed (i.e., written and 
persisted), we might end up reading incomplete or inconsistent snapshot 
metadata.
   
   **Proposed change:** The PR adds a check for the “create transaction ID” 
(similar to how “lastTxnId” is tracked in snapshotInfo). It verifies if the 
double buffer (the mechanism that batches and flushes write operations) has 
flushed the transaction that created the snapshot. Only if the transaction is 
flushed and persisted does the loader proceed to use the snapshot cache.
   
   ### What does this mean in the code?
   * The diff adds logic to store and check a transaction ID associated with 
snapshot creation.
   * When loading a snapshot, instead of just looking for the directory, it now 
looks for both: existence of the directory and confirmation that the 
transaction which created it has been flushed.
   * This helps guarantee that all required metadata files (especially those 
used for snapshot diff) are present and complete.


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