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

DPP-368 enable append-only flag in sandbox #10710

Merged
merged 4 commits into from
Aug 31, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case class IndexerConfig(
updatePreparationParallelism: Int = DefaultUpdatePreparationParallelism,
allowExistingSchema: Boolean = false,
// TODO append-only: remove after removing support for the current (mutating) schema
enableAppendOnlySchema: Boolean = false,
enableAppendOnlySchema: Boolean,
asyncCommitMode: DbType.AsyncCommitMode = DefaultAsyncCommitMode,
maxInputBufferSize: Int = DefaultMaxInputBufferSize,
inputMappingParallelism: Int = DefaultInputMappingParallelism,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ final class JdbcIndexerSpec
jdbcUrl = postgresDatabase.url,
startupMode = IndexerStartupMode.MigrateAndStart,
asyncCommitMode = jdbcAsyncCommitMode,
enableAppendOnlySchema = false,
)
val metrics = new Metrics(new MetricRegistry)
new indexer.JdbcIndexer.Factory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ object IntegrityChecker {
participantId = Ref.ParticipantId.assertFromString("IntegrityCheckerParticipant"),
jdbcUrl = jdbcUrl(config),
startupMode = IndexerStartupMode.MigrateAndStart,
enableAppendOnlySchema = false,
)

private[integritycheck] def jdbcUrl(config: Config): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class RecoveringIndexerIntegrationSpec
jdbcUrl = jdbcUrl,
startupMode = IndexerStartupMode.MigrateAndStart,
restartDelay = restartDelay,
enableAppendOnlySchema = false,
),
servicesExecutionContext = servicesExecutionContext,
metrics = new Metrics(new MetricRegistry),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,21 @@ class CommonCliBase(name: LedgerName) {

// TODO append-only: cleanup
opt[Unit]("enable-compression")
.hidden()
.optional()
.action((_, config) => config.copy(enableCompression = true))
.text(
s"By default compression is off, this switch enables it. This has only effect for append-only ingestion." // TODO append-only: fix description
s"Enables application-side compression of Daml-LF values stored in the database using the append-only schema." +
" By default, compression is disabled."
)

checkConfig(c => {
if (c.enableCompression && !c.enableAppendOnlySchema)
failure(
"Compression (`--enable-compression`) can only be used together with the append-only schema (`--enable-append-only-schema`)."
)
else success
})

com.daml.cliopts.Metrics.metricsReporterParse(this)(
(setter, config) => config.copy(metricsReporter = setter(config.metricsReporter)),
(setter, config) =>
Expand Down
13 changes: 13 additions & 0 deletions ledger/sandbox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,16 @@ server_conformance_test(
"--include=ContractIdIT:Accept",
],
)

# TODO append-only: cleanup
server_conformance_test(
name = "next-conformance-test-append-only",
server_args = [
"--enable-append-only-schema",
],
servers = {"postgresql": NEXT_SERVERS["postgresql"]},
test_tool_args = [
"--open-world",
"--exclude=ClosedWorldIT",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ class Runner(config: SandboxConfig) extends ResourceOwner[Port] {
else IndexerStartupMode.MigrateAndStart,
eventsPageSize = config.eventsPageSize,
allowExistingSchema = true,
enableAppendOnlySchema = config.enableAppendOnlySchema,
enableCompression = config.enableCompression,
rautenrieth-da marked this conversation as resolved.
Show resolved Hide resolved
),
servicesExecutionContext = servicesExecutionContext,
metrics = metrics,
Expand Down Expand Up @@ -255,7 +257,7 @@ class Runner(config: SandboxConfig) extends ResourceOwner[Port] {
// TODO append-only: augment the following defaults for enabling the features for sandbox next
seeding = config.seeding.get,
managementServiceTimeout = config.managementServiceTimeout,
enableAppendOnlySchema = false,
enableAppendOnlySchema = config.enableAppendOnlySchema,
maxContractStateCacheSize = 0L,
maxContractKeyStateCacheSize = 0L,
enableMutableContractStateCache = false,
Expand Down