Skip to content
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

fix: Pool size must be optional #1000

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).

### Deployment Migration Notes

New configuration to access the database:

- `EDC_SERVER_DB_CONNECTION_POOL_SIZE`
- The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. Basically this value will determine the maximum number of actual connections to the database backend.
- Defaults to `3`

#### Compatible Versions

- Connector Backend Docker Images:
Expand All @@ -41,7 +47,7 @@ MDS 2.2 intermediate release

- API Wrapper UI API: Data sources are now well-typed.
- The Broker has been removed in favor of the Authority Portal:
- A new Deployment Unit, the ["Data Catalog Crawler"](extensions/catalog-crawler/README.md), has been added.
- A new Deployment Unit, the ["Data Catalog Crawler"](extensions/catalog-crawler/README.md), has been added.
- Each "Data Catalog Crawler" connects to an existing Authority Portal Deployment's DB.
- Each "Data Catalog Crawler" is responsible for crawling exactly one environment.
- The Data Catalog functionality of the Broker has been integrated into the Authority Portal.
Expand All @@ -63,8 +69,8 @@ MDS 2.2 intermediate release
- Connector:
- The database migration system has been moved from multiple migration history tables to a single one.
- Broker:
- The broker has been removed. For Authority Portal users, please check out the new
[Data Catalog Crawler Productive Deployment Guide](docs/deployment-guide/goals/catalog-crawler-production/README.md).
- The broker has been removed. For Authority Portal users, please check out the new
[Data Catalog Crawler Productive Deployment Guide](docs/deployment-guide/goals/catalog-crawler-production/README.md).
- Any previous broker deployment's database is not required anymore.
- Please care that only some environment variables look similar. It is recommended to create fresh deployments.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ public class DatabaseDirectAccessExtension implements ServiceExtension {
@Setting(defaultValue = "3")
public static final String EDC_SERVER_DB_CONNECTION_POOL_SIZE = "edc.server.db.connection.pool.size";

/**
* Sets the connection timeout for the datasource in milliseconds.
*/
@Setting(defaultValue = "5000")
public static final String EDC_SERVER_DB_CONNECTION_TIMEOUT_IN_MS = "edc.server.db.connection.timeout.in.ms";


@Override
public String name() {
Expand All @@ -75,11 +69,11 @@ private void initializeDirectDatabaseAccess(ServiceExtensionContext context) {
hikariConfig.setUsername(config.getString(EDC_DATASOURCE_JDBC_USER));
hikariConfig.setPassword(config.getString(EDC_DATASOURCE_JDBC_PASSWORD));
hikariConfig.setMinimumIdle(1);
hikariConfig.setMaximumPoolSize(config.getInteger(EDC_SERVER_DB_CONNECTION_POOL_SIZE));
hikariConfig.setMaximumPoolSize(config.getInteger(EDC_SERVER_DB_CONNECTION_POOL_SIZE, 3));
hikariConfig.setIdleTimeout(30000);
hikariConfig.setPoolName("direct-database-access");
hikariConfig.setMaxLifetime(50000);
hikariConfig.setConnectionTimeout(config.getInteger(EDC_SERVER_DB_CONNECTION_TIMEOUT_IN_MS));
hikariConfig.setConnectionTimeout(1000);

val dda = new DslContextFactory(new HikariDataSource(hikariConfig));

Expand Down
Loading