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

limit contract insertion/deletion batching on backpressure #11589

Merged
merged 4 commits into from
Nov 9, 2021

Conversation

S11001001
Copy link
Contributor

@S11001001 S11001001 commented Nov 8, 2021

#3936 uses a limit on batching websocket output under the assumption that clients would rather download their deltas in bite-sized chunks than very large ones. It was inspired by #3192, which also batches transactions to be added to the query store, albeit with no limit.

While #10353 updates #3192 to support arbitrarily large batches as input to the database, we might as well defensively limit ourselves to the largest batch likely to yield any meaningful RDBMS roundtrip reduction time, using a similar technique to #3936. This will also feed more backpressure to the participant server, possibly reducing its own load in high-load scenarios.

CHANGELOG_BEGIN
- [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>`__.
CHANGELOG_END

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description
  • If you mean to change the status of a component, please make sure you keep the Component Status page up to date.

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@S11001001 S11001001 added component/json-api HTTP JSON API team/ledger-clients Related to the Ledger Clients team's components. labels Nov 8, 2021
@S11001001 S11001001 added this to the HTTP JSON API Maintenance milestone Nov 8, 2021
@S11001001 S11001001 self-assigned this Nov 8, 2021
CHANGELOG_BEGIN
- [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>`__.
CHANGELOG_END
@S11001001 S11001001 marked this pull request as ready for review November 8, 2021 21:54
Copy link
Contributor

@stefanobaghino-da stefanobaghino-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@S11001001 Should this be considered for back-porting to prevent issues for users running older versions?

// when considering this cost, keep in mind that each deleteContracts
// may entail a table scan. Backpressure indicates that DB operations
// are slow, the idea here is to set the DB up for success
val maxCost = 250L
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be configurable, rather than hard-coded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think so. The benefit comes from setting a [reasonably large] limit, more than what that limit is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@S11001001 how did we come up with this maxCost value , also can you remind me of the semantics of delete and why it may entail a table scan ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We came up with it by me taking the number 200 from the client output and adding 50 to it. It's a buffer size; it doesn’t really matter what the number is so much as that there is a number and it is reasonably "large" so that the buffer doesn't grow without bound but still gives you good-sized "chunks".

As for the deletes, it depends on how the DB implements delete from contracts where contract_id in (id1, id2, ...).

@S11001001
Copy link
Contributor Author

Should this be considered for back-porting to prevent issues for users running older versions?

I wrote it with that possibility in mind (else, the conflation function would be in fetch-contracts).

@mergify mergify bot merged commit 6372d41 into main Nov 9, 2021
@mergify mergify bot deleted the 10353-contracts-fetch-batchWeighted branch November 9, 2021 19:03
azure-pipelines bot pushed a commit that referenced this pull request Nov 10, 2021
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@remyhaemmerle-da is in charge of this release.

Commit log:
```
9218116 LF: Abstract VersionedValue and VersionedContractInstance (#11533)
b87acab foldLeft, foldRight, other Foldable specializations (#11592)
92dfcde [Self-service error codes] Use error validators in ApiPackageManagementService (#11575)
6372d41 limit contract insertion/deletion batching on backpressure (#11589)
3588284 Fix screenshots in daml intro 2 (#11617)
ef3fc0e Cache type synonym expansion in safeToReexport (#11612)
70b2fe3 Provide byInterface fields for fetch, exercise. (#11607)
830779f LF: drop useless class com.daml.lf.transaction (#11601)
7c92cab Cache type synonym expansion in isDuplicate (#11611)
cfd521f Fix GHC build errors on macOS (#11560)
a7559d0 LF: Rename GenTransaction to Transaction (#11599)
3b61a1b LF: allow exercise command by template for inherited choice. (#11584)
af1bee7 precondition lf conversion (#11538)
f722cf1 Bump extractor init timeout to 60s (#11598)
1e0a221 Set symlink_node_modules = False (#11606)
ac19c8c Synchronize in multi-participant script tests (#11594)
dd1b034 Restart the submission interpretation in case of a race [DPP-737] (#11579)
8d2b1b9 [JSON-API] Port of http-perf-test to sandbox(aka next) (#11543)
56a6db8 codeowners: reflect change in onwership of meiersi-da (#11505)
d433651 fix a few typos in Daml-LF spec (#11583)
5dee88b Refactoring store factories [DPP-709] (#11572)
41fb289 Port LedgerApiServer rate limiter interface from canton (#11577)
04cc5d7 Mark JSON API integration tests as flaky (#11586)
3bed7a9 Drop unused defaultFeatureFlags (#11580)
cbc3c8c Add by_interface field in Create, Fetch, & Exercise transaction nodes. (#11576)
7d68e05 Remove virtual choices (#11482)
9b94fa9 [ledger-api] - metadata for invalid deduplication period [KVL-1170] (#11534)
e7eb60f update compat versions for 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11531)
a3d04ca Migrate matches-docs tests to sandbox on postgres (#11573)
21c9745 [Self-service error codes] ValueSwitch parameterized method (#11567)
6a0b84e Run Script export tests against BR (#11574)
a3195fd fix link to blog (#11570)
0823601 Self-service errors: generate error deprecation docs [KVL-1187] (#11539)
8d48cf6 DPP-664 Create contracts in batches (#11515)
9ef2eaf Remove parameter table join from SQL queries [DPP-705] (#11562)
af7f7f3 Fix LF coedowners (#11563)
4450311 Exclude/fix compatibility tests (#11529)
699c28f rotate release duty after 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11522)
4d4869f interfaces: Improve fixed choice lookup (#11551)
ba96bf7 Add DbDtoToStringsForInterning [DPP-708] (#11557)
692dac6 LF: deprecate remaining type alias in Transaction (#11554)
7bc0f82 [kvutils] - Extract command deduplication steps from the TransactionCommitter [KVL-1174] (#11547)
0e95ccb Wire LedgerEndCache to relevant StorageBackend factories [DPP-704] (#11549)
73cb42e LF: deprecate ensureNoCid and assertNoCid in CidContainer (#11502)
30bfee9 Upgrade canton for conformance tests (#11550)
b84a914 Extractor: replace `sandbox-classic`-based fixtures with `sandbox`-based ones (#11489)
d86fe92 ledger-api-bench-tool - flexible stream filters [DPP-667] (#11458)
214c7ab Self-service errors: generate groups documentation [KVL-1186] (#11526)
60dc286 Avoid unnecessarily decoding DALFs during dependency installation (#11541)
afd79b6 Improve logging for dependency installation (#11540)
fdde535 fix hoogle by pinning nixpkgs (#11548)
5e93df6 Full conformance test with self-service error codes on ledger-on-memory (#11524)
efaf20b update NOTICES file (#11546)
c7bb94b Modify contract key attribute age for createAndExercise to avoid contract key violation on slow running tests (#11530)
541d07c Add string-interning data access [DPP-707] (#11484)
6c94164 Switching to composition at StorageBackend [DPP-704] (#11520)
d006ad0 Add string-interning view primitives [DPP-702] (#11475)
a917520 Save the submission time in the command deduplication value [KVL-1173] (#11509)
669186f Add priority-queue based worker Source [DPP-717] (#11500)
2091f59 Remove cats from kvutils (#11537)
b83af37 Fix recache log statement (#11536)
776790e Add choice collisions in scala name collision checker (#11528)
2efcb21 Extract the setting of the time bounds on the commit context [KVL-1173] (#11516)
9bb1d64 [ledger-api] - Return FAILED_PRECONDITION gRPC status code for invalid deduplication duration [KVL-1170] (#11483)
c098d75 Add a --log-level flag to damlc (#11514)
afee948 Bump rules_nixpkgs (#11517)
d6fb67c release 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11521)
ac49d69 Ensure that -Werror converts parser warnings into errors (#11511)
bda35ca ledger-offset: Add a conversion to ByteString. (#11491)
8a9f15b [DPP-686][Self-service error codes] Removing default error factories (#11403)
bb37eef Switch script & trigger tests to postgres-backed Sadbonx (#11525)
```
Changelog:
```
- [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>`__.
[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".
[ledger-api] - Return max_deduplication_duration as part of the metadata sent with the gRPC status for commands rejected because of invalid deduplication periods

- [Integration Kit] - ledger-api-bench-tool - added flexible party and template filters for transactions, transaction trees and active contract streams

[ledger-api] - Return FAILED_PRECONDITION gRPC status code, instead of INVALID_ARGUMENT, for an invalid command deduplication duration
```

CHANGELOG_BEGIN
CHANGELOG_END
remyhaemmerle-da pushed a commit that referenced this pull request Nov 10, 2021
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@remyhaemmerle-da is in charge of this release.

Commit log:
```
9218116 LF: Abstract VersionedValue and VersionedContractInstance (#11533)
b87acab foldLeft, foldRight, other Foldable specializations (#11592)
92dfcde [Self-service error codes] Use error validators in ApiPackageManagementService (#11575)
6372d41 limit contract insertion/deletion batching on backpressure (#11589)
3588284 Fix screenshots in daml intro 2 (#11617)
ef3fc0e Cache type synonym expansion in safeToReexport (#11612)
70b2fe3 Provide byInterface fields for fetch, exercise. (#11607)
830779f LF: drop useless class com.daml.lf.transaction (#11601)
7c92cab Cache type synonym expansion in isDuplicate (#11611)
cfd521f Fix GHC build errors on macOS (#11560)
a7559d0 LF: Rename GenTransaction to Transaction (#11599)
3b61a1b LF: allow exercise command by template for inherited choice. (#11584)
af1bee7 precondition lf conversion (#11538)
f722cf1 Bump extractor init timeout to 60s (#11598)
1e0a221 Set symlink_node_modules = False (#11606)
ac19c8c Synchronize in multi-participant script tests (#11594)
dd1b034 Restart the submission interpretation in case of a race [DPP-737] (#11579)
8d2b1b9 [JSON-API] Port of http-perf-test to sandbox(aka next) (#11543)
56a6db8 codeowners: reflect change in onwership of meiersi-da (#11505)
d433651 fix a few typos in Daml-LF spec (#11583)
5dee88b Refactoring store factories [DPP-709] (#11572)
41fb289 Port LedgerApiServer rate limiter interface from canton (#11577)
04cc5d7 Mark JSON API integration tests as flaky (#11586)
3bed7a9 Drop unused defaultFeatureFlags (#11580)
cbc3c8c Add by_interface field in Create, Fetch, & Exercise transaction nodes. (#11576)
7d68e05 Remove virtual choices (#11482)
9b94fa9 [ledger-api] - metadata for invalid deduplication period [KVL-1170] (#11534)
e7eb60f update compat versions for 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11531)
a3d04ca Migrate matches-docs tests to sandbox on postgres (#11573)
21c9745 [Self-service error codes] ValueSwitch parameterized method (#11567)
6a0b84e Run Script export tests against BR (#11574)
a3195fd fix link to blog (#11570)
0823601 Self-service errors: generate error deprecation docs [KVL-1187] (#11539)
8d48cf6 DPP-664 Create contracts in batches (#11515)
9ef2eaf Remove parameter table join from SQL queries [DPP-705] (#11562)
af7f7f3 Fix LF coedowners (#11563)
4450311 Exclude/fix compatibility tests (#11529)
699c28f rotate release duty after 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11522)
4d4869f interfaces: Improve fixed choice lookup (#11551)
ba96bf7 Add DbDtoToStringsForInterning [DPP-708] (#11557)
692dac6 LF: deprecate remaining type alias in Transaction (#11554)
7bc0f82 [kvutils] - Extract command deduplication steps from the TransactionCommitter [KVL-1174] (#11547)
0e95ccb Wire LedgerEndCache to relevant StorageBackend factories [DPP-704] (#11549)
73cb42e LF: deprecate ensureNoCid and assertNoCid in CidContainer (#11502)
30bfee9 Upgrade canton for conformance tests (#11550)
b84a914 Extractor: replace `sandbox-classic`-based fixtures with `sandbox`-based ones (#11489)
d86fe92 ledger-api-bench-tool - flexible stream filters [DPP-667] (#11458)
214c7ab Self-service errors: generate groups documentation [KVL-1186] (#11526)
60dc286 Avoid unnecessarily decoding DALFs during dependency installation (#11541)
afd79b6 Improve logging for dependency installation (#11540)
fdde535 fix hoogle by pinning nixpkgs (#11548)
5e93df6 Full conformance test with self-service error codes on ledger-on-memory (#11524)
efaf20b update NOTICES file (#11546)
c7bb94b Modify contract key attribute age for createAndExercise to avoid contract key violation on slow running tests (#11530)
541d07c Add string-interning data access [DPP-707] (#11484)
6c94164 Switching to composition at StorageBackend [DPP-704] (#11520)
d006ad0 Add string-interning view primitives [DPP-702] (#11475)
a917520 Save the submission time in the command deduplication value [KVL-1173] (#11509)
669186f Add priority-queue based worker Source [DPP-717] (#11500)
2091f59 Remove cats from kvutils (#11537)
b83af37 Fix recache log statement (#11536)
776790e Add choice collisions in scala name collision checker (#11528)
2efcb21 Extract the setting of the time bounds on the commit context [KVL-1173] (#11516)
9bb1d64 [ledger-api] - Return FAILED_PRECONDITION gRPC status code for invalid deduplication duration [KVL-1170] (#11483)
c098d75 Add a --log-level flag to damlc (#11514)
afee948 Bump rules_nixpkgs (#11517)
d6fb67c release 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11521)
ac49d69 Ensure that -Werror converts parser warnings into errors (#11511)
bda35ca ledger-offset: Add a conversion to ByteString. (#11491)
8a9f15b [DPP-686][Self-service error codes] Removing default error factories (#11403)
bb37eef Switch script & trigger tests to postgres-backed Sadbonx (#11525)
```
Changelog:
```
- [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>`__.
[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".
[ledger-api] - Return max_deduplication_duration as part of the metadata sent with the gRPC status for commands rejected because of invalid deduplication periods

- [Integration Kit] - ledger-api-bench-tool - added flexible party and template filters for transactions, transaction trees and active contract streams

[ledger-api] - Return FAILED_PRECONDITION gRPC status code, instead of INVALID_ARGUMENT, for an invalid command deduplication duration
```

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <[email protected]>
@akshayshirahatti-da
Copy link
Contributor

looks good 👍

S11001001 added a commit that referenced this pull request Nov 10, 2021
Backport of #11589 / 6372d41.

* move contract insertion/deletion batching to separate function

* limit contract insertion/deletion batching on backpressure

* add changelog

CHANGELOG_BEGIN
- [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>`__.
CHANGELOG_END
stefanobaghino-da added a commit that referenced this pull request Nov 11, 2021
changelog_begin
changelog_end

CHANGELOG ENTRIES

```
[TS-Bindings] Ws multiplexing for stream queries is disabled by default as we investigate issues
of intermittent websocket closures.

* There is now an Early Access Helm chart to start all of the Connect components on a Kubernetes cluster.

[JSON-API] Make certain Hikari cp connection pool properties configurable via jdbc conf 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
- [Integration Kit] - ledger-api-bench-tool can run a workflow consisting of the command submission phase and stream benchmark phase.
- [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>`__.
[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".
[ledger-api] - Return max_deduplication_duration as part of the metadata sent with the gRPC status for commands rejected because of invalid deduplication periods

- [Integration Kit] - ledger-api-bench-tool - added flexible party and template filters for transactions, transaction trees and active contract streams
```

COMMITS

```
d938a44 ws multiplexing is disabled by default as we investigate issues with intermittent web socket closures (#11657)
0f0a865 Make string interning available at ingestion [DPP-711] (#11645)
7296ba4 Move closureConvert and validate compiler phases into separate files. (#11656)
87f282c interfaces: Preserve/provide by_interface data for create actions. (#11639)
a9de728 Update rules_scala (#11616)
f468969 document helm chart (#11648)
55d4a03 Release 1.11.3 snapshot (#11652)
2dd5289 different types for different speedy phases (#11605)
44d604d Release new 1.18 snapshot (#11642)
e69a871 [JSON-API] Configurable Hikari connection pool props  (#11621)
cb7099b release 1.11.3 snapshot (#11628)
fd61d0b String interning read integration [DPP-706] (#11638)
c5a1f0b Republish error codes generator lib (#11633)
a6f745f Add two phase retrieval merge function [DPP-718] (#11571)
743ee46 ledger-api-bench-tool - command submission and stream reading complete workflow [DPP-668] (#11544)
f8f8807 Activate interning write side [DPP-710] (#11614)
93c07f4 Extend synonym expansion caching in data-dependencies (#11629)
cf445b2 Skip platform independence tests on release PRs (#11631)
b8f384e LF: Drop typeparameter from KeyWithMaintainers (#11625)
d0c313d Share dependencyInfo in data-dependencies (#11620)
4eed1d9 release 1.18.0-snapshot.20211109.8328.0.92181161 (#11623)
9218116 LF: Abstract VersionedValue and VersionedContractInstance (#11533)
b87acab foldLeft, foldRight, other Foldable specializations (#11592)
92dfcde [Self-service error codes] Use error validators in ApiPackageManagementService (#11575)
6372d41 limit contract insertion/deletion batching on backpressure (#11589)
3588284 Fix screenshots in daml intro 2 (#11617)
ef3fc0e Cache type synonym expansion in safeToReexport (#11612)
70b2fe3 Provide byInterface fields for fetch, exercise. (#11607)
830779f LF: drop useless class com.daml.lf.transaction (#11601)
7c92cab Cache type synonym expansion in isDuplicate (#11611)
cfd521f Fix GHC build errors on macOS (#11560)
a7559d0 LF: Rename GenTransaction to Transaction (#11599)
3b61a1b LF: allow exercise command by template for inherited choice. (#11584)
af1bee7 precondition lf conversion (#11538)
f722cf1 Bump extractor init timeout to 60s (#11598)
1e0a221 Set symlink_node_modules = False (#11606)
ac19c8c Synchronize in multi-participant script tests (#11594)
dd1b034 Restart the submission interpretation in case of a race [DPP-737] (#11579)
8d2b1b9 [JSON-API] Port of http-perf-test to sandbox(aka next) (#11543)
56a6db8 codeowners: reflect change in onwership of meiersi-da (#11505)
d433651 fix a few typos in Daml-LF spec (#11583)
5dee88b Refactoring store factories [DPP-709] (#11572)
41fb289 Port LedgerApiServer rate limiter interface from canton (#11577)
04cc5d7 Mark JSON API integration tests as flaky (#11586)
3bed7a9 Drop unused defaultFeatureFlags (#11580)
cbc3c8c Add by_interface field in Create, Fetch, & Exercise transaction nodes. (#11576)
7d68e05 Remove virtual choices (#11482)
9b94fa9 [ledger-api] - metadata for invalid deduplication period [KVL-1170] (#11534)
e7eb60f update compat versions for 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11531)
a3d04ca Migrate matches-docs tests to sandbox on postgres (#11573)
21c9745 [Self-service error codes] ValueSwitch parameterized method (#11567)
6a0b84e Run Script export tests against BR (#11574)
a3195fd fix link to blog (#11570)
0823601 Self-service errors: generate error deprecation docs [KVL-1187] (#11539)
8d48cf6 DPP-664 Create contracts in batches (#11515)
9ef2eaf Remove parameter table join from SQL queries [DPP-705] (#11562)
af7f7f3 Fix LF coedowners (#11563)
4450311 Exclude/fix compatibility tests (#11529)
699c28f rotate release duty after 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11522)
4d4869f interfaces: Improve fixed choice lookup (#11551)
ba96bf7 Add DbDtoToStringsForInterning [DPP-708] (#11557)
692dac6 LF: deprecate remaining type alias in Transaction (#11554)
7bc0f82 [kvutils] - Extract command deduplication steps from the TransactionCommitter [KVL-1174] (#11547)
0e95ccb Wire LedgerEndCache to relevant StorageBackend factories [DPP-704] (#11549)
73cb42e LF: deprecate ensureNoCid and assertNoCid in CidContainer (#11502)
30bfee9 Upgrade canton for conformance tests (#11550)
b84a914 Extractor: replace `sandbox-classic`-based fixtures with `sandbox`-based ones (#11489)
d86fe92 ledger-api-bench-tool - flexible stream filters [DPP-667] (#11458)
214c7ab Self-service errors: generate groups documentation [KVL-1186] (#11526)
60dc286 Avoid unnecessarily decoding DALFs during dependency installation (#11541)
afd79b6 Improve logging for dependency installation (#11540)
fdde535 fix hoogle by pinning nixpkgs (#11548)
5e93df6 Full conformance test with self-service error codes on ledger-on-memory (#11524)
efaf20b update NOTICES file (#11546)
c7bb94b Modify contract key attribute age for createAndExercise to avoid contract key violation on slow running tests (#11530)
541d07c Add string-interning data access [DPP-707] (#11484)
6c94164 Switching to composition at StorageBackend [DPP-704] (#11520)
d006ad0 Add string-interning view primitives [DPP-702] (#11475)
a917520 Save the submission time in the command deduplication value [KVL-1173] (#11509)
669186f Add priority-queue based worker Source [DPP-717] (#11500)
2091f59 Remove cats from kvutils (#11537)
b83af37 Fix recache log statement (#11536)
776790e Add choice collisions in scala name collision checker (#11528)
2efcb21 Extract the setting of the time bounds on the commit context [KVL-1173] (#11516)
9bb1d64 [ledger-api] - Return FAILED_PRECONDITION gRPC status code for invalid deduplication duration [KVL-1170] (#11483)
c098d75 Add a --log-level flag to damlc (#11514)
afee948 Bump rules_nixpkgs (#11517)
d6fb67c release 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11521)
ac49d69 Ensure that -Werror converts parser warnings into errors (#11511)
bda35ca ledger-offset: Add a conversion to ByteString. (#11491)
8a9f15b [DPP-686][Self-service error codes] Removing default error factories (#11403)
bb37eef Switch script & trigger tests to postgres-backed Sadbonx (#11525)
```

Since `v1.18.0-snapshot.20211102.8257.0.7391a3cd`
mergify bot pushed a commit that referenced this pull request Nov 12, 2021
changelog_begin
changelog_end

CHANGELOG ENTRIES

```
[TS-Bindings] Ws multiplexing for stream queries is disabled by default as we investigate issues
of intermittent websocket closures.

* There is now an Early Access Helm chart to start all of the Connect components on a Kubernetes cluster.

[JSON-API] Make certain Hikari cp connection pool properties configurable via jdbc conf 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
- [Integration Kit] - ledger-api-bench-tool can run a workflow consisting of the command submission phase and stream benchmark phase.
- [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>`__.
[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".
[ledger-api] - Return max_deduplication_duration as part of the metadata sent with the gRPC status for commands rejected because of invalid deduplication periods

- [Integration Kit] - ledger-api-bench-tool - added flexible party and template filters for transactions, transaction trees and active contract streams
```

COMMITS

```
d938a44 ws multiplexing is disabled by default as we investigate issues with intermittent web socket closures (#11657)
0f0a865 Make string interning available at ingestion [DPP-711] (#11645)
7296ba4 Move closureConvert and validate compiler phases into separate files. (#11656)
87f282c interfaces: Preserve/provide by_interface data for create actions. (#11639)
a9de728 Update rules_scala (#11616)
f468969 document helm chart (#11648)
55d4a03 Release 1.11.3 snapshot (#11652)
2dd5289 different types for different speedy phases (#11605)
44d604d Release new 1.18 snapshot (#11642)
e69a871 [JSON-API] Configurable Hikari connection pool props  (#11621)
cb7099b release 1.11.3 snapshot (#11628)
fd61d0b String interning read integration [DPP-706] (#11638)
c5a1f0b Republish error codes generator lib (#11633)
a6f745f Add two phase retrieval merge function [DPP-718] (#11571)
743ee46 ledger-api-bench-tool - command submission and stream reading complete workflow [DPP-668] (#11544)
f8f8807 Activate interning write side [DPP-710] (#11614)
93c07f4 Extend synonym expansion caching in data-dependencies (#11629)
cf445b2 Skip platform independence tests on release PRs (#11631)
b8f384e LF: Drop typeparameter from KeyWithMaintainers (#11625)
d0c313d Share dependencyInfo in data-dependencies (#11620)
4eed1d9 release 1.18.0-snapshot.20211109.8328.0.92181161 (#11623)
9218116 LF: Abstract VersionedValue and VersionedContractInstance (#11533)
b87acab foldLeft, foldRight, other Foldable specializations (#11592)
92dfcde [Self-service error codes] Use error validators in ApiPackageManagementService (#11575)
6372d41 limit contract insertion/deletion batching on backpressure (#11589)
3588284 Fix screenshots in daml intro 2 (#11617)
ef3fc0e Cache type synonym expansion in safeToReexport (#11612)
70b2fe3 Provide byInterface fields for fetch, exercise. (#11607)
830779f LF: drop useless class com.daml.lf.transaction (#11601)
7c92cab Cache type synonym expansion in isDuplicate (#11611)
cfd521f Fix GHC build errors on macOS (#11560)
a7559d0 LF: Rename GenTransaction to Transaction (#11599)
3b61a1b LF: allow exercise command by template for inherited choice. (#11584)
af1bee7 precondition lf conversion (#11538)
f722cf1 Bump extractor init timeout to 60s (#11598)
1e0a221 Set symlink_node_modules = False (#11606)
ac19c8c Synchronize in multi-participant script tests (#11594)
dd1b034 Restart the submission interpretation in case of a race [DPP-737] (#11579)
8d2b1b9 [JSON-API] Port of http-perf-test to sandbox(aka next) (#11543)
56a6db8 codeowners: reflect change in onwership of meiersi-da (#11505)
d433651 fix a few typos in Daml-LF spec (#11583)
5dee88b Refactoring store factories [DPP-709] (#11572)
41fb289 Port LedgerApiServer rate limiter interface from canton (#11577)
04cc5d7 Mark JSON API integration tests as flaky (#11586)
3bed7a9 Drop unused defaultFeatureFlags (#11580)
cbc3c8c Add by_interface field in Create, Fetch, & Exercise transaction nodes. (#11576)
7d68e05 Remove virtual choices (#11482)
9b94fa9 [ledger-api] - metadata for invalid deduplication period [KVL-1170] (#11534)
e7eb60f update compat versions for 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11531)
a3d04ca Migrate matches-docs tests to sandbox on postgres (#11573)
21c9745 [Self-service error codes] ValueSwitch parameterized method (#11567)
6a0b84e Run Script export tests against BR (#11574)
a3195fd fix link to blog (#11570)
0823601 Self-service errors: generate error deprecation docs [KVL-1187] (#11539)
8d48cf6 DPP-664 Create contracts in batches (#11515)
9ef2eaf Remove parameter table join from SQL queries [DPP-705] (#11562)
af7f7f3 Fix LF coedowners (#11563)
4450311 Exclude/fix compatibility tests (#11529)
699c28f rotate release duty after 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11522)
4d4869f interfaces: Improve fixed choice lookup (#11551)
ba96bf7 Add DbDtoToStringsForInterning [DPP-708] (#11557)
692dac6 LF: deprecate remaining type alias in Transaction (#11554)
7bc0f82 [kvutils] - Extract command deduplication steps from the TransactionCommitter [KVL-1174] (#11547)
0e95ccb Wire LedgerEndCache to relevant StorageBackend factories [DPP-704] (#11549)
73cb42e LF: deprecate ensureNoCid and assertNoCid in CidContainer (#11502)
30bfee9 Upgrade canton for conformance tests (#11550)
b84a914 Extractor: replace `sandbox-classic`-based fixtures with `sandbox`-based ones (#11489)
d86fe92 ledger-api-bench-tool - flexible stream filters [DPP-667] (#11458)
214c7ab Self-service errors: generate groups documentation [KVL-1186] (#11526)
60dc286 Avoid unnecessarily decoding DALFs during dependency installation (#11541)
afd79b6 Improve logging for dependency installation (#11540)
fdde535 fix hoogle by pinning nixpkgs (#11548)
5e93df6 Full conformance test with self-service error codes on ledger-on-memory (#11524)
efaf20b update NOTICES file (#11546)
c7bb94b Modify contract key attribute age for createAndExercise to avoid contract key violation on slow running tests (#11530)
541d07c Add string-interning data access [DPP-707] (#11484)
6c94164 Switching to composition at StorageBackend [DPP-704] (#11520)
d006ad0 Add string-interning view primitives [DPP-702] (#11475)
a917520 Save the submission time in the command deduplication value [KVL-1173] (#11509)
669186f Add priority-queue based worker Source [DPP-717] (#11500)
2091f59 Remove cats from kvutils (#11537)
b83af37 Fix recache log statement (#11536)
776790e Add choice collisions in scala name collision checker (#11528)
2efcb21 Extract the setting of the time bounds on the commit context [KVL-1173] (#11516)
9bb1d64 [ledger-api] - Return FAILED_PRECONDITION gRPC status code for invalid deduplication duration [KVL-1170] (#11483)
c098d75 Add a --log-level flag to damlc (#11514)
afee948 Bump rules_nixpkgs (#11517)
d6fb67c release 1.18.0-snapshot.20211102.8257.0.7391a3cd (#11521)
ac49d69 Ensure that -Werror converts parser warnings into errors (#11511)
bda35ca ledger-offset: Add a conversion to ByteString. (#11491)
8a9f15b [DPP-686][Self-service error codes] Removing default error factories (#11403)
bb37eef Switch script & trigger tests to postgres-backed Sadbonx (#11525)
```

Since `v1.18.0-snapshot.20211102.8257.0.7391a3cd`
S11001001 added a commit that referenced this pull request Nov 12, 2021
…11647)

Backport of #11589 / 6372d41.

* move contract insertion/deletion batching to separate function

* limit contract insertion/deletion batching on backpressure

* add changelog

CHANGELOG_BEGIN
- [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>`__.
CHANGELOG_END
stefanobaghino-da added a commit that referenced this pull request Dec 6, 2021
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
stefanobaghino-da added a commit that referenced this pull request Dec 6, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/json-api HTTP JSON API team/ledger-clients Related to the Ledger Clients team's components.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants