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

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   Derby is retired (no further releases or fixes). This PR switches the Recon 
SQL DB to SQLite and removes the Derby dependency. It is stacked on #11649 
(HDDS-14451), which makes SQLite work with Recon; please review only the last 
commit.
   
   The native driver concern from HDDS-3411 no longer applies to ppc64le: 
current sqlite-jdbc maps `ppc64le` to its bundled library. s390x is still not 
bundled, so building and running Recon on s390x needs a locally built 
`libsqlitejdbc`.
   
   Changes:
   - jOOQ code generation runs against a temporary SQLite DB instead of Derby. 
The generated classes are the same except for the key constant names in `Keys` 
(now prefixed with the table name, not referenced anywhere) and timestamp 
precision metadata.
   - `ozone.recon.sql.db.driver`, `ozone.recon.sql.db.jdbc.url` and 
`ozone.recon.sql.db.jooq.dialect` now default to SQLite 
(`jdbc:sqlite:${ozone.recon.db.dir}/ozone_recon_sqlite.db`).
   - A Derby URL or dialect in the configuration is no longer usable. Recon 
logs a warning and uses the SQLite defaults instead of failing to start.
   - Upgrade: Recon SQL tables only hold derived data, so the new SQLite DB 
starts empty and is repopulated. If `ozone_recon_derby.db` exists in the Recon 
DB dir, the new DB starts at the initial Recon layout version instead of the 
software version, so all upgrade actions run (including the NSSummary rebuild 
for clusters upgrading from older releases). The old Derby DB is left on disk 
and Recon logs that it can be deleted.
   - Removed `DerbyDataSourceProvider` and the Derby helpers in `SqlDbUtils`. 
`SqlDbUtils.constraintExists` now reads the table definition from 
`sqlite_master`.
   - Removed Derby from the poms, `LICENSE.txt`, `jar-report.txt` and the 
dependabot config.
   - Tests and the local cluster use SQLite. 
`TestUnhealthyContainersDerbyPerformance` is renamed to 
`TestUnhealthyContainersSqlitePerformance` and uses a file based DB.
   
   Behavior differences on SQLite, covered by test updates:
   - JDBC metadata reports `BIGINT` columns as `INTEGER` and `TIMESTAMP` 
columns as `VARCHAR`.
   - Timestamps are stored with millisecond precision. This only matters for 
`CLUSTER_GROWTH_DAILY`, which has a timestamp in its primary key and is not 
used.
   
   User facing docs will be updated in a separate apache/ozone-site PR.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16668
   
   ## How was this patch tested?
   
   - Full Recon unit test suite (876 tests) passes on SQLite.
   - New `TestReconUtils#testSqlDbDerbyConfigFallsBackToSqlite` and 
`TestReconUtils#testFreshInstallVersionAfterDerby`.
   - Compared the generated jOOQ sources with the ones generated from Derby.
   - Integration tests in `integration-test-recon` compile; to be run in CI.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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