-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
participant-integration-api: Store a status gRPC protobuf. [KVL-1005] (…
…#10600) * participant-integration-api: Construct completions in one place. * sandbox-classic: Inline `CompletionFromTransaction#apply`. It's only used here; there's no reason to keep it in the _participant-integration-api_. * participant-integration-api: Store a status gRPC protobuf. Instead of storing the status code and message, we store a serialized `google.rpc.Status` protocol buffers message. This allows us to pass through any additional information reported by the driver `ReadService`. The migration is only done for the append-only database, and preserves old data in the existing columns. New data will only be written to the new column. CHANGELOG_BEGIN CHANGELOG_END * participant-integration-api: Improve comments in migrations. Co-authored-by: Fabio Tudone <fabio.tudone@digitalasset.com> * participant-integration-api: Further improvements to migrations. * participant-integration-api: Store the rejection status as 3 columns. Serializing the details but keeping the code and message columns populated. * participant-integration-api: Publish the indexer protobuf to Maven. Co-authored-by: Fabio Tudone <fabio.tudone@digitalasset.com>
- Loading branch information
Showing
17 changed files
with
222 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
ledger/participant-integration-api/src/main/protobuf/daml/platform/index.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Serialization format for Protocol Buffers values stored in the index. | ||
// | ||
// WARNING: | ||
// As all messages declared here represent values stored to the index database, we MUST ensure that | ||
// they remain backwards-compatible forever. | ||
|
||
syntax = "proto3"; | ||
|
||
package daml.platform.index; | ||
|
||
option java_package = "com.daml.platform.index"; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
// Serialized status details, conveyed from the driver `ReadService` to the ledger API client. | ||
// To be combined with a status code and message. | ||
message StatusDetails { | ||
repeated google.protobuf.Any details = 1; | ||
} |
2 changes: 1 addition & 1 deletion
2
...n-api/src/main/resources/db/migration/h2database-appendonly/V1__Append_only_schema.sha256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0d8451829143e22581afc5b31930bb0ff8c5efab89a3eaca0ed2e57454fc6823 | ||
e560dcc7af3b3b333a3d61668c351c7c1a1a0ac088bf83b59e0b4699a8073951 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ation-api/src/main/resources/db/migration/oracle-appendonly/V1__Append_only_schema.sha256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
c6e4c74b1c854a51d9cd79d3c614b60a372ca60e88b8d69cbd90a7a674389080 | ||
16adf83956d0f884d1d8886f317b3c0929839a9b0c385b5cb40c6e42cf328ef4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...resources/db/migration/postgres-appendonly/V106__add_rejection_status_proto_column.sha256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
824b012135f72b24d8393c412535432e4b2c669075e012971220f14eeb7bdaae |
15 changes: 15 additions & 0 deletions
15
...in/resources/db/migration/postgres-appendonly/V106__add_rejection_status_proto_column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
-- Adds a column to store extra details for the rejection status. | ||
-- | ||
-- The `rejection_status_details` column contains a Protocol-Buffers-serialized message of type | ||
-- `daml.platform.index.StatusDetails`, containing the code, message, and further details | ||
-- (decided by the ledger driver), and may be `NULL` even if the other two columns are set. | ||
|
||
ALTER TABLE participant_command_completions | ||
RENAME COLUMN status_code TO rejection_status_code; | ||
ALTER TABLE participant_command_completions | ||
RENAME COLUMN status_message TO rejection_status_message; | ||
ALTER TABLE participant_command_completions | ||
ADD COLUMN rejection_status_details BYTEA; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.