Skip to content

Commit

Permalink
[In-memory fan-out] Oracle support (#10263)
Browse files Browse the repository at this point in the history
* [In-memory fan-out] Oracle support

CHANGELOG_BEGIN
CHANGELOG_END

* Correct so Oracle backend works with fan out enabled - add implicit conversion and correct view defaulting for BLOB fields
Add missing tests to oracle append only spec as it lagged behind postgres and h2
Regen sql sha for oracle

CHANGELOG_BEGIN
CHANGELOG_END

* avoid global import of implicit that is not needed

* reduce duplication on conformance test targets

* update sha for oracle append only flyway scripts

Co-authored-by: Brian Healey <[email protected]>
  • Loading branch information
tudor-da and dasormeter authored Jul 14, 2021
1 parent a8f1902 commit ba8e829
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
25 changes: 22 additions & 3 deletions ledger/ledger-on-sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ conformance_test(
)

conformance_test(
name = "conformance-test-append-only-in-memory-fan-out",
name = "conformance-test-append-only-in-memory-fan-out-postgres",
ports = [6865],
server = ":conformance-test-postgresql-bin",
server_args = [
Expand All @@ -420,6 +420,23 @@ conformance_test(
],
)

conformance_test(
name = "conformance-test-append-only-in-memory-fan-out-oracle",
ports = [6865],
server = ":conformance-test-oracle-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1,ledger-api-transactions-buffer-max-size=10",
"--index-append-only-schema-unsafe",
"--mutable-contract-state-cache-unsafe",
"--buffered-ledger-api-streams-unsafe",
],
tags = [] if oracle_testing else ["manual"],
test_tool_args = [
"--verbose",
],
)

conformance_test(
name = "conformance-test-append-only-pruning-postgres",
ports = [6865],
Expand Down Expand Up @@ -463,9 +480,10 @@ conformance_test(
server = ":conformance-test-oracle-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1,ledger-api-transactions-buffer-max-size=10",
"--index-append-only-schema-unsafe",
"--mutable-contract-state-cache-unsafe",
"--buffered-ledger-api-streams-unsafe",
],
tags = [] if oracle_testing else ["manual"],
test_tool_args = [
Expand Down Expand Up @@ -532,9 +550,10 @@ conformance_test(
server = ":conformance-test-oracle-bin",
server_args = [
"--contract-id-seeding=testing-weak",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1",
"--participant participant-id=conformance-test,port=6865,contract-state-cache-max-size=1,contract-key-state-cache-max-size=1,ledger-api-transactions-buffer-max-size=10",
"--index-append-only-schema-unsafe",
"--mutable-contract-state-cache-unsafe",
"--buffered-ledger-api-streams-unsafe",
],
tags = [] if oracle_testing else ["manual"],
test_tool_args = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3a97d06a4b4c852487e8145296297805e0f1eee2cfb462558f13c21ae2cfcf47
7f4fb78d28927012f3c4b3a91b87b38dbebdd6c32f3654cf23fb75213be096ba
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,11 @@ SELECT cast(0 as SMALLINT) AS event_kind,
to_clob('[]') AS create_signatories,
to_clob('[]') AS create_observers,
cast(NULL as VARCHAR2(4000)) AS create_agreement_text,
EMPTY_BLOB() AS create_key_value,
NULL AS create_key_value,
cast(NULL as VARCHAR2(4000)) AS create_key_hash,
cast(NULL as VARCHAR2(4000)) AS exercise_choice,
EMPTY_BLOB() AS exercise_argument,
EMPTY_BLOB() AS exercise_result,
NULL AS exercise_argument,
NULL AS exercise_result,
to_clob('[]') AS exercise_actors,
to_clob('[]') AS exercise_child_event_ids,
participant_events_divulgence.create_argument_compression,
Expand Down Expand Up @@ -462,8 +462,8 @@ SELECT (10) AS event_kind,
participant_events_create.create_key_value,
participant_events_create.create_key_hash,
cast(NULL as VARCHAR2(4000)) AS exercise_choice,
EMPTY_BLOB() AS exercise_argument,
EMPTY_BLOB() AS exercise_result,
NULL AS exercise_argument,
NULL AS exercise_result,
to_clob('[]') AS exercise_actors,
to_clob('[]') AS exercise_child_event_ids,
participant_events_create.create_argument_compression,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,8 @@ private[backend] trait CommonStorageBackend[DB_BATCH] extends StorageBackend[DB_
).foreach(_.execute()(connection))
}

private val rawTransactionEventParser: RowParser[RawTransactionEvent] =
private val rawTransactionEventParser: RowParser[RawTransactionEvent] = {
import com.daml.platform.store.Conversions.ArrayColumnToStringArray.arrayColumnToStringArray
(int("event_kind") ~
str("transaction_id") ~
int("node_index") ~
Expand Down Expand Up @@ -912,6 +913,7 @@ private[backend] trait CommonStorageBackend[DB_BATCH] extends StorageBackend[DB_
offset,
)
}
}

def rawEvents(startExclusive: Long, endInclusive: Long)(
connection: Connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ class JdbcLedgerDaoOracleAppendOnlySpec
with JdbcLedgerDaoSuite
with JdbcLedgerDaoBackendOracleAppendOnly
with JdbcLedgerDaoPackagesSpec
with JdbcLedgerDaoPartiesSpec
with JdbcLedgerDaoConfigurationSpec
with JdbcLedgerDaoConfigurationAppendOnlySpec
with JdbcLedgerDaoActiveContractsSpec
with JdbcLedgerDaoCompletionsSpec
with JdbcLedgerDaoConfigurationSpec
with JdbcLedgerDaoConfigurationAppendOnlySpec
with JdbcLedgerDaoContractsSpec
with JdbcLedgerDaoContractsAppendOnlySpec
with JdbcLedgerDaoDivulgenceSpec
with JdbcLedgerDaoExceptionSpec
with JdbcLedgerDaoPartiesSpec
with JdbcLedgerDaoTransactionsSpec
with JdbcLedgerDaoTransactionTreesSpec
with JdbcLedgerDaoContractEventsStreamSpec
with JdbcLedgerDaoTransactionsWriterSpec
with JdbcLedgerDaoTransactionLogUpdatesSpec
with JdbcAppendOnlyTransactionInsertion

0 comments on commit ba8e829

Please sign in to comment.