-
Notifications
You must be signed in to change notification settings - Fork 205
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
[JSON-API] Backport of connection pool for 1.11.x , configurable db options needs forward porting #11615
Conversation
…igurable connection pool size CHANGELOG_BEGIN Backport of Hikari connection pool for 1.11.x plus addition of a configurable pool size parameter to jdbcConfig. CHANGELOG_END
a3b2f08
to
a9c3910
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.
Nice! Thanks for tackling this so quickly
ledger-service/http-json/src/main/scala/com/digitalasset/http/Config.scala
Show resolved
Hide resolved
ledger-service/http-json/src/main/scala/com/digitalasset/http/Config.scala
Show resolved
Hide resolved
@@ -82,7 +82,7 @@ object Main extends StrictLogging { | |||
case _ => | |||
} | |||
|
|||
val serviceF: Future[HttpService.Error \/ ServerBinding] = | |||
val serviceF: Future[HttpService.Error \/ (ServerBinding, Option[ContractDao])] = |
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.
maybe worth having an httpservice
class that contains the server binding & optional dao and abstracts away the details of closing? Not as part of the backport but separately
ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/ContractDao.scala
Outdated
Show resolved
Hide resolved
ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/ContractDao.scala
Outdated
Show resolved
Hide resolved
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.
Please retitle; if we think this PR is only a backport, that will constitute a regression in main
. (In other words, needs-forward-port
)
ledger-service/http-json/src/main/scala/com/digitalasset/http/Config.scala
Outdated
Show resolved
Hide resolved
ledger-service/http-json/src/main/scala/com/digitalasset/http/Config.scala
Outdated
Show resolved
Hide resolved
ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/ContractDao.scala
Outdated
Show resolved
Hide resolved
Changelog --------- ``` - [JSON-API] added metrics to separately track: - time taken to update query-store ACS (from ledger) - lookup times for the query store [HTTP/JSON API] - metrics reporting can now be chosen via the command line option --metrics-reporter (currently hidden), valid options are console, csv://, graphite:// and prometheus:// - metrics reporting interval can also now be chosen via a command line option --metrics-reporting-interval (currently hidden) - [Ledger HTTP Json Service] Logging output can now be in JSON either via providing the cli option `--log-encoder json` or via setting the env var `LOG_FORMAT_JSON=true` [HTTP-JSON] - fixed that json log output could not be enabled via cli options except via usage of env vars - [Ledger HTTP Json service] Logging can now be configured via the `--log-level` cli argument. Valid values are `error`, `warn`, `info` (default), `debug`, `trace` - [Ledger HTTP Json Service] Logging now also tells service name if log level was changed. http-json: - add contextual id as logging context to distinguish different application runs in logs - add request id as logging context to distinguish different http requests within an application run - add for non-static endpoints trace logs which show how long processing it took in ns - [JSON API] Fix an error where transactions that delete a large number of contracts resulted in stackoverflows with the PostgreSQL backend and database errors with Oracle. - [JSON API] While updating the contract table for a query, if the DB appears to be slow, JSON API will slow down its own inserts and deletes at some point rather than construct ever-larger INSERT and DELETE batch commands. See `issue #11589 <https://github.com/digital-asset/daml/pull/11589>`__. Backport of Hikari connection pool for 1.11.x plus addition of configurable connection pool properties to jdbcConfig string, the properties are listed below poolSize -- specifies the max pool size for the database connection pool minIdle -- specifies the min idle connections for database connection pool connectionTimeout -- long value, specifies the connection timeout for database connection pool idleTimeout -- long value, specifies the idle timeout for the database connection pool [Ledger API] Retry the interpretation of a command in case of a race with other transactions. This fix drastically reduces the likelihood of the error "Could not find a suitable ledger time after 0 retries". For every update in the index db log the full context at the INFO level. [Integration Kit] The state of the participant indexer can now be checked via the GRPC health endpoint ``` Commits ------- ``` c679b4a [1.11.x] Metrics for investigating json api performance (#11769) 437c3d4 Bump Windows postgres (#11806) 382168b Add metrics to the http json service (#9923) (#11768) b7fc305 [Backport] Add cli option & system property to enable json only logging for the json api (#11717) 17cacb0 [Backport] Add logging command line option to ledger http service (#9581) (#11699) 56531e8 Backport: Support deletion of a large number of contracts (#11646) 6bf19fc Backport: limit contract insertion/deletion batching on backpressure (#11647) eed4ad3 Backport signing tool changes (#11651) ee7547e [JSON-API] Backport of connection pool for 1.11.x , configurable db options needs forward porting (#11615) 632ba5a Backport: Avoid collision in execution log postfix (#11644) cf4f1a1 Backport: add tar to dev-env (#10173) (#11636) b78fa8c Backport: Restart the submission interpretation in case of a race [DPP-737] (#11578) 5c3220d Fix build of release/1.11.x branch (#11582) cce7c79 Log context of all updates written to the database (#10057) a9d0473 Adds Indexer state to GRPC health checks [DPP-434] (#9951) (#9961) ``` changelog_begin changelog_end
Changelog --------- ``` - [JSON-API] added metrics to separately track: - time taken to update query-store ACS (from ledger) - lookup times for the query store [HTTP/JSON API] - metrics reporting can now be chosen via the command line option --metrics-reporter (currently hidden), valid options are console, csv://, graphite:// and prometheus:// - metrics reporting interval can also now be chosen via a command line option --metrics-reporting-interval (currently hidden) - [Ledger HTTP Json Service] Logging output can now be in JSON either via providing the cli option `--log-encoder json` or via setting the env var `LOG_FORMAT_JSON=true` [HTTP-JSON] - fixed that json log output could not be enabled via cli options except via usage of env vars - [Ledger HTTP Json service] Logging can now be configured via the `--log-level` cli argument. Valid values are `error`, `warn`, `info` (default), `debug`, `trace` - [Ledger HTTP Json Service] Logging now also tells service name if log level was changed. http-json: - add contextual id as logging context to distinguish different application runs in logs - add request id as logging context to distinguish different http requests within an application run - add for non-static endpoints trace logs which show how long processing it took in ns - [JSON API] Fix an error where transactions that delete a large number of contracts resulted in stackoverflows with the PostgreSQL backend and database errors with Oracle. - [JSON API] While updating the contract table for a query, if the DB appears to be slow, JSON API will slow down its own inserts and deletes at some point rather than construct ever-larger INSERT and DELETE batch commands. See `issue #11589 <https://github.com/digital-asset/daml/pull/11589>`__. Backport of Hikari connection pool for 1.11.x plus addition of configurable connection pool properties to jdbcConfig string, the properties are listed below poolSize -- specifies the max pool size for the database connection pool minIdle -- specifies the min idle connections for database connection pool connectionTimeout -- long value, specifies the connection timeout for database connection pool idleTimeout -- long value, specifies the idle timeout for the database connection pool [Ledger API] Retry the interpretation of a command in case of a race with other transactions. This fix drastically reduces the likelihood of the error "Could not find a suitable ledger time after 0 retries". For every update in the index db log the full context at the INFO level. [Integration Kit] The state of the participant indexer can now be checked via the GRPC health endpoint ``` Commits ------- ``` c679b4a [1.11.x] Metrics for investigating json api performance (#11769) 437c3d4 Bump Windows postgres (#11806) 382168b Add metrics to the http json service (#9923) (#11768) b7fc305 [Backport] Add cli option & system property to enable json only logging for the json api (#11717) 17cacb0 [Backport] Add logging command line option to ledger http service (#9581) (#11699) 56531e8 Backport: Support deletion of a large number of contracts (#11646) 6bf19fc Backport: limit contract insertion/deletion batching on backpressure (#11647) eed4ad3 Backport signing tool changes (#11651) ee7547e [JSON-API] Backport of connection pool for 1.11.x , configurable db options needs forward porting (#11615) 632ba5a Backport: Avoid collision in execution log postfix (#11644) cf4f1a1 Backport: add tar to dev-env (#10173) (#11636) b78fa8c Backport: Restart the submission interpretation in case of a race [DPP-737] (#11578) 5c3220d Fix build of release/1.11.x branch (#11582) cce7c79 Log context of all updates written to the database (#10057) a9d0473 Adds Indexer state to GRPC health checks [DPP-434] (#9951) (#9961) ``` changelog_begin changelog_end
Backport of Hikari connection pool for 1.11.x plus addition of a configurable pool size parameter to jdbcConfig.
Forward porting of configurable db options for
main
is on #11621fixes #11596
CHANGELOG_BEGIN
[JSON-API] Backport of Hikari connection pool for 1.11.x plus addition of a configurable pool size parameter to jdbcConfig.
CHANGELOG_END
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.