Skip to content

Commit

Permalink
Fix oracle message too long error (#10413)
Browse files Browse the repository at this point in the history
* simplify oracle migration scripts

* CHANGELOG_BEGIN
simplify oracle migration scripts
CHANGELOG_END
  • Loading branch information
danielporterda authored Jul 27, 2021
1 parent 2094e24 commit 39c6e0b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7f4fb78d28927012f3c4b3a91b87b38dbebdd6c32f3654cf23fb75213be096ba
c6e4c74b1c854a51d9cd79d3c614b60a372ca60e88b8d69cbd90a7a674389080
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ CREATE TABLE participant_command_completions

transaction_id NVARCHAR2(1000), -- null if the command was rejected and checkpoints
status_code INTEGER, -- null for successful command and checkpoints
status_message NVARCHAR2(1000) -- null for successful command and checkpoints
status_message CLOB -- null for successful command and checkpoints
);

CREATE INDEX participant_command_completions_idx ON participant_command_completions(completion_offset, application_id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5438a2b69c6c7581166e6498cdaac09c46945e0f01e5fb7359de0f85cbb130a4
250ca12b5c10f57334d9c5f763bd8aab4ac564b0d6b6589ad976da404d3a2738
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ CREATE TABLE participant_command_completions

transaction_id NVARCHAR2(1000), -- null if the command was rejected and checkpoints
status_code INTEGER, -- null for successful command and checkpoints
status_message NVARCHAR2(1000) -- null for successful command and checkpoints
status_message CLOB -- null for successful command and checkpoints
);

create index participant_command_completions_idx on participant_command_completions(completion_offset, application_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package com.daml.platform.store.dao

import java.time.Instant
import java.util.UUID

import akka.stream.scaladsl.Sink
import com.daml.ledger.api.v1.command_completion_service.CompletionStreamResponse
import com.daml.ledger.offset.Offset
import com.daml.ledger.participant.state.v1.RejectionReasonV0
import com.daml.ledger.participant.state.{v1 => state}
import com.daml.lf.data.Ref
import com.daml.platform.ApiOffset
Expand Down Expand Up @@ -189,6 +189,20 @@ private[dao] trait JdbcLedgerDaoCompletionsSpec extends OptionValues with LoneEl
succeed
}
}
it should "allow arbitrarily large rejection reasons" in {
for {
from <- ledgerDao.lookupLedgerEnd()
_ <- storeMultiPartyRejection(
RejectionReasonV0.Inconsistent((0 to 10000).map(_ => " ").mkString(""))
)
to <- ledgerDao.lookupLedgerEnd()
response1 <- ledgerDao.completions
.getCommandCompletions(from, to, applicationId, Set("WRONG"))
.runWith(Sink.seq)
} yield {
response1 shouldBe Seq.empty
}
}

private def prepareStoreRejection(
reason: state.RejectionReasonV0,
Expand Down

0 comments on commit 39c6e0b

Please sign in to comment.