ArafatKhan2198 opened a new pull request, #9407: URL: https://github.com/apache/ozone/pull/9407
## What changes were proposed in this pull request? This PR fixes a race condition during Recon startup where the metrics system attempts to query the `RECON_TASK_STATUS` table before the schema upgrade (adding new columns) has completed. The proposed change moves the `layoutVersionManager.finalizeLayoutFeatures()` call to execute **before** `start()` is called in `ReconServer.java`. This ensures that all database schema upgrades, such as adding the `last_task_run_status` column, are fully applied before any services or metrics collectors (like `ReconTaskStatusMetrics`) are started and begin querying the database. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-14046 ## How was this patch tested? - Verified on a running cluster that layout feature finalization works as expected after schema changes. - Confirmed that the new columns in RECON_TASK_STATUS are added and populated correctly. - Ran affected unit tests (TestSchemaVersionTableDefinition, TestInitialConstraintUpgradeAction, and TestReconLayoutVersionManager) which now use mock DataSource instead of SCMFacade. - Checked logs to ensure the layout upgrade flow logs feature versions and schema updates cleanly. -- 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]
