HDDS-11465. Introducing Schema Versioning for Recon Derby table to Handle Fresh Installs and Upgrades. #7213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
ReconSchemaVersionTable
.Added
upgradeSchema
Method to Schema Definitions: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
:createAndUpgradeReconSchema
method was updated to first initialize all tables, then loop through each table'supgradeSchema
method to apply migrations if needed.New
ReconSchemaVersionTableManager
Class:ReconSchemaVersionTable
.Centralized Version Tracking:
ReconConstants
).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