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

   ## What changes were proposed in this pull request?
   ### Problem Statemement:
   
   The problem arises when upgrading from clusters where the schema version 
framework was not previously implemented. In such cases, the schema version 
table is newly created, but other tables already exist in the system. Since 
there is no recorded Metadata Layout Version (MLV), the system incorrectly 
assumes that the schema is at an uninitialized state (-1), leading to 
unnecessary execution of all upgrade actions. This behavior can cause 
inefficiencies and unintended changes, as the system fails to distinguish 
between fresh installs and upgrades from older versions without the schema 
framework.
   
   ### Solution Implementation:
   
   - The `createReconSchema` method ensures the `SCHEMA_VERSION_TABLE` is 
initialized first.
   - During Table Creation:
       - **Fresh Install**: Detect that all tables are newly created, if they 
are then set the MLV to match the latest SLV, and skip unnecessary upgrades.
       - **Upgrading from a pre-upgrade framework version**: Identify 
pre-upgraded clusters where the schema version table is newly created while 
other tables already exist. In this scenario, initialize the MLV to `-1` to 
indicate the starting point of the upgrade framework and execute only the 
necessary upgrades to bring the schema to the latest state.
   - The latest SLV is dynamically calculated from `ReconLayoutFeature` and 
passed to the schema version manager.
   
   ### Results of the New Code Changes:
   
   - **Fresh Install**: The MLV is correctly initialized to the latest SLV, 
avoiding unnecessary upgrade actions.
   - **Upgrade Scenario**: The schema version is set to `-1`, ensuring only 
relevant upgrades are performed.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-11846
   
   ## How was this patch tested?
   Manually Tested
   


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