Commit Graph

1559 Commits

Author SHA1 Message Date
Moritz Kiefer
4e63299919
Simplify kvutils contract keys validation (#9628)
changelog_begin
changelog_end
2021-05-17 11:38:27 +00:00
Andreas Herrmann
010e2b1b27
Fix client_server_build/test with port file (#9701)
* client_server runner - use temp dir for port file

The sandbox will not overwrite an already existing port file but instead
fail, or worse, silently ignore the error and leave the port-file empty.

changelog_begin
changelog_end

* sandbox: Fail if writing the port file fails

So far this was being silently ignored, leaving a pre-existing port-file
untouched.

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-05-17 11:36:25 +00:00
Miklos
395ff58eec
Damlification of Bazel files (#9670)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-17 11:41:44 +02:00
Moritz Kiefer
4b3b9ef165
Add race condition tests for exceptions (#9688)
* Add race condition tests for exceptions

This PR addresses
https://github.com/digital-asset/daml/pull/9400#pullrequestreview-634770251
and adds tests that match RaceConditionTests but to the read side in a
rollback (we cannot do writes in rollbacks, they are rolled back :)).

The tests are as close as possible to the other race condition tests
to ease maintenance and reduce confusion.

changelog_begin
changelog_end

* remove commented lines

changelog_begin
changelog_end

* Disable accidentally enabled ClosedWorldIT

changelog_begin
changelog_end
2021-05-14 17:36:25 +02:00
Hubert Slojewski
927242be40
KVL-914 Add and rework unit tests for tracing (#9686)
* Add and rework unit tests for tracing
CHANGELOG_BEGIN
CHANGELOG_END

* Add assertion

* Minor cleanup

* Add missing header

* Remove an empty line
2021-05-14 16:36:29 +02:00
Moritz Kiefer
ed14f97528
Move race condition utilities to test tool infrastructure (#9685)
This is a preparatory refactoring PR so we can use the same utilities
for the existing race condition tests and for a test suite that tests
race conditions in combinations with exceptions.

changelog_begin
changelog_end
2021-05-14 13:39:06 +02:00
Brian Healey
af7f88fca5
restore natural join and avoid table aliasing in participant contracts queries (#9671)
* restore natural join

CHANGELOG_BEGIN
CHANGELOG_END

* JOIN with ON clause rather than NATURAL JOIN so table aliasing will work cross-platform

* scalafmt
2021-05-12 14:37:25 -04:00
Hubert Slojewski
c282a09ffb
KVL-914 Expose metrics-test-lib for the oem integration kit (#9662)
* Expose metrics-test-lib for the oem integration kit
CHANGELOG_BEGIN
CHANGELOG_END

* Change the instrumentation name for tests
2021-05-12 16:13:23 +02:00
Marton Nagy
691915353c
Fix update metrics population in parallel indexer (#9655)
changelog_begin
changelog_end
2021-05-12 12:09:06 +00:00
Robert Autenrieth
111e1d3798
Fix sandbox classic package upload (#9633)
* Fix sandbox classic package upload

changelog_begin
changelog_end

* Refactor code
2021-05-12 08:51:36 +02:00
Stephen Compall
ca9e89b3da
check whether collection.compat is unused when compiling for Scala 2.12 (#9604)
* check whether collection.compat is unused when compiling for Scala 2.12

- Instead of always suppressing warnings for collection.compat._,
  we should only do it for Scala 2.13

- We can also reduce boilerplate by automatically adding this
  option when both silencer_plugin and collection-compat are
  present

CHANGELOG_BEGIN
CHANGELOG_END

* remove unused import

* remove another unused import

* remove even more unused imports

* missed compat dependency

* more missed compat dependencies

* missed compat dependency

* use scala_deps in scaladoc_jar

- #8423 inlined the major version expansion, but this seems to
  have been prior to proper support by scaladoc_jar

* restore custom handling of participant-integration-api

- fixing scaladoc_jar isn't worth it for a single case, as with
  deps vs scala_deps
2021-05-11 21:54:14 +00:00
Marton Nagy
f8b35fef9c
Cleans stateUpdates of ReadWriteServiceBridge (#9630)
In order not to make the appearance that current state of sandbox-on-x can support anything than clean initialization form scratch, and clean initialization from already ingested database.

changelog_begin
changelog_end
2021-05-11 10:02:18 +00:00
Kamil Bożek
3b59f8ce87
ledger-api-bench-tool - prototype [DPP-370] (#9606)
* Simple scaffolding for the ledger-api-bench-tool

* Added README

* Added resource management and the LedgerIdentityService

* Changed the default log level to DEBUG

* Added the TransactionService

* Added stream configuration options

* Options for ledger configuration

* Minor improvements

* Refactored packages

* Minor improvement

* CHANGELOG_BEGIN
- [Integration Kit] - Created the ledger-api-bench-tool prototype for benchmarking ledger transaction streaming capabilities
CHANGELOG_END

* Unified endpoint argument with the ledger-api-test-tool + other minor fixes

* Logger as an argument to LogOnlyObserver
2021-05-11 10:19:57 +02:00
Samir Talwar
6c919b3877
sandbox-on-x: Support beginAfter in state updates. (#9624)
* sandbox-on-x: Support `beginAfter` in state updates.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox-on-x: Update a TODO comment.
2021-05-10 14:50:15 +00:00
Sofia Faro
9242540022
Make error throw a GeneralError. (#9613)
* Make error throw a GeneralError.

As well as abort, fail, etc.

changelog_begin
changelog_end

* keep the error message when you have an unhandled error in scenario

* Disable crashing opsem tests for now.

* Update CommandServiceIT regex pattern.

* Put | in wrong place :-|

* forgot to escape "

* Illegal repetition!
2021-05-10 10:47:43 +01:00
Moritz Kiefer
4c1fbeb194
Add duplicate contract key checks to Speedy (#9607)
changelog_begin
changelog_end
2021-05-07 17:24:42 +00:00
Remy
871279f3a6
LF: extends LF command with Fetch and Lookup (#9587)
This PR includes  :

- Adding ApiCommand to distinguish between generic command (that are
  accepted by the engine) and command that are accepted by the ledger
  API.

- Reimplement Canton's reinterpret method using commands instead of
  node.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-07 19:19:25 +02:00
Marton Nagy
cf59246d44
Add support for daml exceptions for append-only indexer (#9609)
This change adds support for append-only sandbox-classic as well.
Temporarily enabled tests ensure correctness for now
In parallel-ingestion stabilisation epic further unit tests willbe added (hence keeping the TODO for now)

changelog_begin
changelog_end
2021-05-07 11:48:28 +02:00
Marton Nagy
b09a95fb6f
Adapt indexer to empty divulgences (#9598)
changelog_begin
changelog_end
2021-05-06 18:58:01 +00:00
Moritz Kiefer
2fc7489e44
Filter divulgence to an empty set of parties (#9600)
* Filter divulgence to an empty set of parties

As @nmarton-da noticed painfully, we currently include divulgence to
an empty set of parties. While this is arguably not wrong it is at
least confusing and useless. The whole point of divulgence is to track
visibility. Divulging to an empty set of parties does not affect
visibility so it is not meaningfully different from no
divulgence. Therefore this PR filters it out and adds a doc comment
that the list of divulgees is always non-empty.

changelog_begin
changelog_end

* Fix tests

changelog_begin
changelog_end
2021-05-06 18:33:30 +00:00
Samir Talwar
ad45213b66
participant-integration-api: Avoid the serial EC in integration testing. (#9603)
The behavior of LedgerConfigProvider is time-sensitive at startup. The
test was accidentally supplying the serial execution context, which
meant that the initialization process could be blocked by a lack of
available threads, causing the wrong result.

Switching to the materializer's execution context avoids this issue in
testing, and does not impact production logic.

In general, resource owners should not accept execution contexts
implicitly. Looks like I added this one, so everyone else is off the
hook. I will punish myself by ordering a pizza.

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-06 17:48:21 +00:00
Marton Nagy
f742a4334e
Dpp 336 sandbox classic on append only (#9561)
This change adds support of append-only schema in sandbox-classic and daml-on-sql ledgers: this is available with feature flag.
The support is PoC grade, it will be stabilized/productionized in the upcoming epic.
Currently enabled CI tests in the respective projects guarding this implementation.

* Introduce SequentialWriteDao for simplified indexing in sandbox-classic
* Use this in appendonly.JdbcLedgerDao to implement necessary methods
* Add support for ledgerEnd query to StorageBackend
* Fix JdbcLedgerDao creation (supporting append-only)
* Add feature flag and wiring for sandbox-classic
* Activate conformance tests with append-only on sandbox-classic
* Add support/ci coverage for daml-on-sql

changelog_begin
changelog_end
2021-05-06 19:32:08 +02:00
Moritz Kiefer
e68bc0dff0
Mark reset service tests as flaky (#9602)
Reset service is cursed

changelog_begin
changelog_end
2021-05-06 17:15:51 +00:00
Robert Autenrieth
03034ec3bf
DPP-359 Add indexer flow level benchmark (#9509)
* Add indexer flow level benchmark

changelog_begin
changelog_end

* Add readme

* Address review comments

* Fix scala 2.13 build

* Small improvements

* fix format errors
2021-05-06 15:43:34 +00:00
Hubert Slojewski
968b5d8d39
KVL-921 Expose opentelemetry Context from Telemetry and TelemetryContext (#9573)
* Expose opentelemetry Context from Telemetry and TelemetryContext
CHANGELOG_BEGIN
CHANGELOG_END

* Add tests and docs
2021-05-06 16:28:45 +02:00
Victor Peter Rouven Müller
112c387e5a
Refactor out setGlobalLogLevel into ContextualLogging (#9592)
CHANGELOG_BEGIN

- [Ledger HTTP Json Service] Logging now also tells service name if log level was changed.

CHANGELOG_END
2021-05-06 14:23:39 +00:00
Gerolf Seitz
5128206ebf
Ledger API Server: Named threadpools (#9588)
Some cached threadpools weren't given names, meaning at runtime there
are a bunch of pool-x-thread-y threads. This makes it hard to understand
which threads are being used for what.

The following pool names were introduced:

append-only indexer: input-mapping-pool, batching-pool
ProgramResource: program-resource-pool
kvutils PackageCommitter: package-preload-executor

CHANGELOG_BEGIN
CHANGELOG_END
2021-05-06 10:28:45 +02:00
Moritz Kiefer
409833f850
Address rollback todo in ancient migration (#9583)
Just crashing here would actually be fine since this migration will
never run on a transaction with a rollback node but it’s easy enough
to fix it properly and that raises fewer questions.

changelog_begin
changelog_end
2021-05-05 18:15:38 +02:00
Moritz Kiefer
a27b2c56bc
Address more exception todos (#9582)
* Address more exception todos

A bit of a kitchen sink PR to address a bunch of the trivial todos
that didn’t seem worth splitting out into separate PRs.

changelog_begin
changelog_end

* Revert changes to TransactionSpec

changelog_begin
changelog_end
2021-05-05 16:00:08 +02:00
Moritz Kiefer
2040556dbb
Support rollback nodes in replay adapter (#9584)
changelog_begin
changelog_end
2021-05-05 13:47:47 +00:00
Moritz Kiefer
de80a6dc60
Drop ValueBuiltinException (#9576)
As discussed, we don’t want to expose this via serializable values at
least for now (and it’s not exposed on the ledger API anyway) so this
PR drops the type.

changelog_begin
changelog_end
2021-05-05 12:32:58 +02:00
Hubert Slojewski
2e93de79a4
Fix recording exceptions in Spans, add unit tests [KVL-874] (#9544)
* Fix recording exceptions in Spans, add unit tests
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-04 17:06:57 +02:00
mziolekda
b6a2984be2
log all external requests at an info level (#9560)
* log all external requests at an info level
CHANGELOG_BEGIN
CHANGELOG_END

* additional logs in the transaction service
CHANGELOG_BEGIN
Log ledger-api client read requests at the info level. Affects following services
- Active Contracts Service
- Command Completion Service
- Ledger Configuration Service
- Ledger Identity Service
- Package Service
- Time Service
- Transaction Service
CHANGELOG_END
2021-05-04 13:44:52 +00:00
Kamil Bożek
39afcc4857
Fix index size limit issues [DPP-347] (#9477)
* Added a new test suite for testing limit API values - ValueLimitsIT

* Change index on participant_command_completions table
This change fixes issues with commands with large submitters number on sandbox-classic

* Added key_hash column to the ledger *state table
The new column is now the primary key of the table. Its values are hashed values of the 'key' column which allows to mitigate limitations on the index row size

* Backfill key_hash for ledger_state table

* Dynamic state table prefix form the backfill migration

* Removed redundant comments

* Backfill migration for all the db types

* Added missing copyright comment

* Fixed migration order after a rebase

* Added missing checksums for sql migrations

* Temporarily removed copyrights from one of sql migrations

* Removed unnecessary NOT NULL constraint

* Removed submitters from the index participant_command_completion_offset_application_idx in the append-only schema

* Disabled the test for old platforms

* CHANGELOG_BEGIN
- [Integration Kit] - a new test suite ValueLimitsIT for testing edge case values
- [Integration Kit] - modified index on the participant_command_completions table to avoid issuess with a large number of submitters
- [Sandbox] - added the key_hash column to the *state table
CHANGELOG_END

* Disabled concurrent testing for the ValueLimitsIT:VLLargeSubmittersNumberCreateContract test case

* Recomputed migrations checksums for the participant-integration-api

* Increase the sandbox-on-x queue size to 500
The motivation is that running conformance tests failed with RESOURCE_EXHAUSTED error due to 200 limit on the queue.

* Minor improvement

* Inlined key hashing for migrations to avoid external dependencies

* Minor improvement

* Fixed migrations hash
2021-05-04 12:23:37 +02:00
Hubert Slojewski
bef8af2bb6
Propagate trace context for configuration submission (#9545)
CHANGELOG_BEGIN
CHANGELOG_END
2021-05-04 09:38:56 +02:00
Moritz Kiefer
dce6a16649
Add Ledger API test tool tests for exceptions (#9400)
* Add Ledger API test tool tests for exceptions

changelog_begin
changelog_end

* Update daml-lf/language/daml-lf.bzl

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

* Address review comments

changelog_begin
changelog_end

* Shuffle around test

changelog_begin
changelog_end

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2021-05-03 18:40:52 +02:00
mziolekda
22fcbccc7a
publish ledger-on-memory to maven (#9548)
* publish ledger-on-memory to maven
changelog_begin
changelog_end

* modify the list of published artifacts
2021-05-03 15:17:27 +02:00
Bernhard Elsner
340643eae2
Add a sentence to the DDfPSQL docs to give a download link (#9534)
CHANGELOG_BEGIN
CHANGELOG_END
2021-04-30 18:11:27 +02:00
Hubert Slojewski
0e5c4d4782
KVL-919 Propagate trace context for package upload (#9543)
CHANGELOG_BEGIN
CHANGELOG_END
2021-04-30 16:51:25 +02:00
Moritz Kiefer
a937a66463
Fix TransactionCommitter.trimUnnecessaryNodes for rollback nodes (#9536)
* Fix TransactionCommitter.trimUnnecessaryNodes for rollback nodes

changelog_begin
changelog_end

* Update ledger/participant-state/kvutils/src/test/suite/scala/com/daml/ledger/participant/state/kvutils/committer/transaction/TransactionCommitterSpec.scala

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* switch error code

changelog_begin
changelog_end

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2021-04-30 12:17:58 +00:00
Marton Nagy
b25c904fc8
Introduce combined storeTransaction method in LedgerDao for sandbox-classic (#9540)
Motivation of this PR: with the help of this combined method, wiring of the
append-only schema ingestion becomes possible.

* Add proper implementation for dao
* Adapts sandbox-classic usage

changelog_begin
changelog_end
2021-04-30 09:09:53 +00:00
Marton Nagy
c85da6def0
Minor refactoring (#9539)
* Add TODO comments to guide further work
* Add and wire up StorageBackend factory

changelog_begin
changelog_end
2021-04-29 23:47:13 +00:00
Marton Nagy
d2fb1f3759
Moving StorageBackend and related artifacts to their proper place (#9535)
This PR is exclusively about moving files around, no code change.

changelog_begin
changelog_end
2021-04-29 17:15:37 +00:00
Oliver Seeliger
88928414cb
Creating empty oracle scala flyway migration package (#9522)
* Precreate Oracle indexer scala migration package

This avoids needing to special case FlywayMigrations to not include
scala migrations which will be more robust when adding the first oracle-based
scala migration.

changelog_begin
changelog_end

* Review feedback - remove FIXME
2021-04-29 17:18:32 +02:00
Moritz Kiefer
4aca199bbd
Upgrade to Scala 2.13.5 (#9528)
changelog_begin
changelog_end
2021-04-29 13:05:57 +00:00
Marton Nagy
ec86d97653
First draw of an interface separating ingestion and storage (#9517)
The intent of this change is to make the first step in this direction
in order to support dpp-336 work of sanbdox-classic integration by
injecting DAO functionality via this interface.
Level of quality is still pre-production, hence TODO comments.
Planned next step: move StorageBackend interface, and implementation
to platform/store, to it's final place.

* Introduce StorageBackend interface
* Decouple event-seq-id assignment logic from storage specific batching
* Pull out of batching step from input mapping, execution too
* Switch to stateless DAO functions
* Switch to DBDispatcher instead of custom JDBC Connection pool
* Introduce/adapt metrics
* Naturally extend configuration
* Move RunningBatch layer to ParallelIndexerFactory
* Remove dead code

changelog_begin
changelog_end
2021-04-29 12:54:25 +00:00
Samir Talwar
9527b2e2ab
kvutils: Make Step a trait to carry the logging context more easily. (#9525)
Implicits and lambdas don't work well together.

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-29 08:05:59 +00:00
Moritz Kiefer
977b23ac9f
Support rollback nodes in ActiveStateManager (#9486)
* Support rollback nodes in ActiveStateManager

If some one can point me to existing tests for ActiveStateManager,
I’ll happily extend them I failed to find any.

I did test it against #9400 and it fixes most tests and the failing
ones fail in other parts so at that level it seems to work as
expected.

changelog_begin
changelog_end

* Better comments

changelog_begin
changelog_end

* less Set()

changelog_begin
changelog_end

* switch pattern matching

changelog_begin
changelog_end

* Clarify comment

changelog_begin
changelog_end

* Simplify tracking of archivedIds

changelog_begin
changelog_end

* Document where ActiveLedgerStateManager is used

changelog_begin
changelog_end

* Blow up when using rollback nodes with a mutable ALS

changelog_begin
changelog_end
2021-04-29 10:02:57 +02:00
Hubert Slojewski
ceec40b299
Propagate trace context for party allocation (#9524)
CHANGELOG_BEGIN
CHANGELOG_END
2021-04-29 09:42:15 +02:00
Samir Talwar
56a0448c7b
kvutils: Use the contextualized logger in the committer. (#9516)
This means we don't have to provide context explicitly on each log line;
it'll get passed through.

We include extra logging context, extracted from the state at each step.

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-28 12:00:56 +00:00