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

participant-integration-api: Store a status gRPC protobuf. [KVL-1005] #10600

Merged
merged 8 commits into from
Aug 18, 2021
Prev Previous commit
Next Next commit
participant-integration-api: Improve comments in migrations.
Co-authored-by: Fabio Tudone <fabio.tudone@digitalasset.com>
  • Loading branch information
SamirTalwar and fabiotudone-da committed Aug 17, 2021
commit 5217ed4edb5265c17f8f91b9fb0fc2c883d39546
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e64e1bc672d79af26e86ca8e495a31c6ef026ae6c6df86b3101d9d942954e745
2c67203c14e8cd9a316f8a2787be30cf13ecb9eedcafa49876b8f9b63b99bc71
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@ CREATE TABLE participant_command_completions (
command_id VARCHAR NOT NULL,
-- The transaction ID is `NULL` for rejected transactions.
transaction_id VARCHAR,
-- The rejection status is `NULL` if the completion is for an accepted transaction.
-- The three columns below are `NULL` if the completion is for an accepted transaction.
-- The `rejection_status` contains a Protocol-Buffers-serialized message of type
This conversation was marked as resolved.
Show resolved Hide resolved
-- `google.rpc.Status`, containing the code, message, and further details (decided by the ledger
This conversation was marked as resolved.
Show resolved Hide resolved
-- driver). The `rejection_status_code` and `rejection_status_message` columns will always be
-- `NULL` in an H2-backed index, but we keep them for parity with old data in other databases.
-- driver).
-- The `rejection_status_code` and `rejection_status_message` columns will always be
-- `NULL` in an H2-backed index, as data is not persisted across ledger restarts. However, we
This conversation was marked as resolved.
Show resolved Hide resolved
-- keep them for parity with old data in other databases.
rejection_status_code INTEGER,
rejection_status_message VARCHAR,
rejection_status BLOB
This conversation was marked as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -325,6 +327,9 @@ CREATE INDEX participant_events_consuming_exercise_tree_event_witnesses_idx ON p
-- lookup by contract id
CREATE INDEX participant_events_consuming_exercise_contract_id_idx ON participant_events_consuming_exercise (contract_id);

-- Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
This conversation was marked as resolved.
Show resolved Hide resolved
-- SPDX-License-Identifier: Apache-2.0

---------------------------------------------------------------------------------------------------
-- Events table: non-consuming exercise
---------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
525584affccdd5c5a6b20eac660b068ba1db392c1da7a6c95c3d3a70e46913d3
7cd06324d0b97f384401b77a0d0af4bf7e949427c812097bc5c565f68c8bfee6
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ CREATE TABLE participant_command_completions
submitters CLOB NOT NULL CONSTRAINT ensure_json_submitters CHECK (submitters IS JSON),
command_id NVARCHAR2(1000) NOT NULL,

transaction_id NVARCHAR2(1000), -- null if the command was rejected and checkpoints
rejection_status_code INTEGER, -- null for successful command and checkpoints
rejection_status_message CLOB, -- null for successful command and checkpoints
rejection_status BLOB -- null for successful command and checkpoints
transaction_id NVARCHAR2(1000), -- null for rejected transactions and checkpoints
rejection_status_code INTEGER, -- null for accepted transactions and checkpoints
rejection_status_message CLOB, -- null for accepted transactions and checkpoints
rejection_status BLOB -- null for accepted transactions and checkpoints
);

CREATE INDEX participant_command_completions_idx ON participant_command_completions(completion_offset, application_id);
Expand Down Expand Up @@ -387,6 +387,9 @@ CREATE TABLE participant_events_non_consuming_exercise (
-- offset index: used to translate to sequential_id
CREATE INDEX participant_events_non_consuming_exercise_event_offset ON participant_events_non_consuming_exercise(event_offset);

-- Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
This conversation was marked as resolved.
Show resolved Hide resolved
-- SPDX-License-Identifier: Apache-2.0

-- sequential_id index for paging
CREATE INDEX participant_events_non_consuming_exercise_event_sequential_id ON participant_events_non_consuming_exercise(event_sequential_id);

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
454de41175e6f9d5b4a7b125ef06a57115342384b39898f85208cce572a1d4d4
e97a66e8f6431ff0dd19d48b46bbe1b90ef7d840be9145e73a567107de06db04
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
-- SPDX-License-Identifier: Apache-2.0

-- Store the completion status as a serialized Protocol Buffers message of type `google.rpc.Status`.

--
-- The `rejection_status` contains a Protocol-Buffers-serialized message of type
-- `google.rpc.Status`, containing the code, message, and further details (decided by the ledger
-- driver). We do not migrate the `rejection_status_code` and `rejection_status_message` columns,
-- and so they may contain old data, which means we need to keep them.
-- driver).
--
-- We only rename the `rejection_status_code` and `rejection_status_message` columns, and so they
-- may contain historical data. Readers of this table will therefore need to query for all three
-- columns and either use the `google.rpc.Status` message in `rejection_status` if it exists, or
-- construct one from the `rejection_status_code` and `rejection_status_message` if it does not.

ALTER TABLE participant_command_completions
RENAME COLUMN status_code TO rejection_status_code;
Expand Down