Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
Recon is documented to support SQLite through
ozone.recon.sql.db.driverandozone.recon.sql.db.jdbc.url, but several Derby specific paths break it. This PR makes SQLite work out of the box. Derby stays the default; switching the default is left to HDDS-16668.ReconControllerModule: when the JDBC URL contains${ozone.recon.db.dir}, the whole URL was replaced with a hard coded Derby URL. Now only the placeholder is resolved (with the sameozone.metadata.dirsfallback as the other Recon DBs), so a SQLite URL is kept. The default URL resolves to the same path as before. A custom URL containing the placeholder (a different Derby file name, or a SQLite URL that silently ran on Derby) now opens the configured DB, which starts empty and is repopulated.DefaultDataSourceProvider: pick the provider by the URL scheme (jdbc:derby:/jdbc:sqlite:) instead of a substring match, so a DB path containing "derby" does not select the wrong driver.SqliteDataSourceProvider: enable WAL and a 60s busy timeout (same as Derby's default lock wait timeout). SQLite allows one writer at a time; with the default rollback journal a long reader, such as the unhealthy container CSV export, blocks all writers until it finishes. WAL lets readers and the writer proceed concurrently, and the busy timeout makes writers wait instead of failing withSQLITE_BUSY. Ajournal_modeorbusy_timeoutset in the URL is kept.SQLiteDataSourceignores a URLbusy_timeout(its config always sets one), so that value is applied explicitly.ReconTaskStatusUpdaterManager: the column check queried Derby'sSYS.SYSCOLUMNSwith an upper case column name, which never matched (Derby stores the quoted lower case name), solast_task_run_statusandis_current_task_runningwere reset to 0 on every restart, on Derby too. It now usesSqlDbUtils.columnExists(JDBC metadata), which works on both DBs.AbstractReconSqlDBTest: a custom provider passed to the constructor was overwritten by the Derby provider ininit(), soTestReconWithDifferentSqlDBsnever actually ran against SQLite. It now keeps the custom provider.With these changes the full Recon unit test suite passes on SQLite except for test side expectations (JDBC type codes, timestamp precision), which are handled in HDDS-16668.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14451
How was this patch tested?
New tests:
TestReconWithDifferentSqlDBs#testTaskStatusPreservedOnReload(Derby and SQLite): task status columns survive a reload. Fails without the fix on both DBs.TestReconWithDifferentSqlDBs#testSqliteUsesWalAndBusyTimeout: WAL and busy timeout are set, andjournal_modeandbusy_timeoutin the URL are kept.TestReconWithDifferentSqlDBs#testSqliteSelectedByUrlScheme: a DB dir containing "derby" still gets the SQLite data source.TestReconUtils#testSqlDbJdbcUrlResolvesReconDbDirPlaceholder: the placeholder resolves to theozone.metadata.dirsfallback.Recon unit tests pass locally.
🤖 Generated with Claude Code