ArafatKhan2198 opened a new pull request, #7213:
URL: https://github.com/apache/ozone/pull/7213
## What changes were proposed in this pull request?
In Recon, as new features and enhancements are introduced, changes to the
database schema are required. Versioning ensures that Recon’s schema is
upgraded smoothly across different installations and updates. It helps track
which version of the schema is currently applied, preventing inconsistencies
between the code and the database.
### Summary of Changes:
- Introduced Schema Versioning System:
- Implemented a mechanism to track the schema version in a dedicated
`ReconSchemaVersionTable`.
- All schema version upgrades for the different tables are coordinated to
ensure consistency across the system.
- Added `upgradeSchema` Method to Schema Definitions:
- Each table's schema definition now includes an `upgradeSchema` method to
handle version-specific migrations. This method is responsible for running any
necessary DDL changes when upgrading to a new schema version.
- Modified `ReconSchemaManager`:
- The `createAndUpgradeReconSchema` method was updated to first initialize
all tables, then loop through each table's `upgradeSchema` method to apply
migrations if needed.
- This ensures that all tables are created or upgraded in sync with the
version specified in the system.
- New `ReconSchemaVersionTableManager` Class:
- Added a new class responsible for fetching and updating the schema
version from the `ReconSchemaVersionTable`.
- This class manages reading the current schema version and updating it
once all migrations have been successfully applied.
- Centralized Version Tracking:
- Defined the current schema version for the entire system in a central
configuration file (`ReconConstants`).
- This version acts as the reference point for both initial schema
creation and migrations. All tables will be migrated in line with this version.
- These changes ensure that the database schema remains consistent with the
application code as it evolves, allowing smooth upgrades and initialization
across different environments.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11465
## 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]