-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Load initial catalogs in TestingTrinoServer #26986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load initial catalogs in TestingTrinoServer #26986
Conversation
Reviewer's GuideDistributedQueryRunner now automatically loads initial catalogs from the configured CatalogStore at startup by invoking ConnectorServicesProvider.loadInitialCatalogs. Tests have been refactored to remove manual catalog loading calls, introduce a prepopulated in-memory catalog store with a simulated broken catalog via a TestCatalogStoreModule, and update assertions to reflect the new initialization behavior. Sequence diagram for DistributedQueryRunner startup and initial catalog loadingsequenceDiagram
participant DQR as DistributedQueryRunner
participant Coord as Coordinator
participant CSP as ConnectorServicesProvider
participant CS as CatalogStore
DQR->>Coord: getInstance(ConnectorServicesProvider)
Coord->>CSP: return ConnectorServicesProvider
DQR->>CSP: loadInitialCatalogs()
CSP->>CS: Load initial catalogs
CS-->>CSP: Return loaded catalogs
CSP-->>DQR: Catalogs initialized
Class diagram for PrepopulatedInMemoryCatalogStore and TestCatalogStoreModuleclassDiagram
class PrepopulatedInMemoryCatalogStore {
+Map<String, Catalog> catalogs
+PrepopulatedInMemoryCatalogStore(Map<String, Catalog> catalogs)
+getCatalog(String name)
+listCatalogs()
}
class TestCatalogStoreModule {
+configure()
+Provides PrepopulatedInMemoryCatalogStore
}
PrepopulatedInMemoryCatalogStore <.. TestCatalogStoreModule: provides
Class diagram for ConnectorServicesProvider with loadInitialCatalogs methodclassDiagram
class ConnectorServicesProvider {
+loadInitialCatalogs()
+other methods...
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
33ffca7 to
4a63696
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| closeAllSuppress(e, queryRunner); | ||
| throw e; | ||
| } | ||
| queryRunner.getCoordinator().getInstance(Key.get(ConnectorServicesProvider.class)).loadInitialCatalogs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we do it in io.trino.server.testing.TestingTrinoServer#TestingTrinoServer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
3a497f9 to
4258ddf
Compare
Description
Previously catalogs were not loaded correctly when TestingTrinoServer /DistributedQueryRunner was used
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:
Summary by Sourcery
Ensure DistributedQueryRunner automatically loads initial catalogs on startup and update tests to configure and verify healthy and failing catalogs via a custom CatalogStore.
Bug Fixes:
Enhancements:
Tests: