daml/ledger/ledger-on-sql/hash-migrations.sh

14 lines
394 B
Bash
Raw Normal View History

Heartbeats for Sandbox-Next, ledger-on-sql, and ledger-on-memory. (#4755) * kvutils: Make the `KeyValueParticipantStateReader` tests more rigorous. If the `offset` is specified as `None`, expect it to be `None`, not just anything. * kvutils: Simplify `KeyValueParticipantStateReader#stateUpdates`. Construct the Source with `Source.apply`, not `Source.fromIterator`. * kvutils: Use multiple entry IDs in `KeyValueParticipantStateReaderSpec`. * kvutils: Add basic tests to `KeyValueParticipantStateReaderSpec`. * kvutils: Add heartbeats to `LedgerReader`'s `events` output. Heartbeats are optional, to be delivered by the ledger if and when it deems necessary. * sandbox-next: An observing time service backend using Akka streams. * sandbox-next: A regular heartbeat based on Akka Streams' `tick`. * sandbox: Replace `TimeServiceBackend.withObserver` with `.observing`. More code, but it's more decoupled, so can more easily be sent to the underlying backend in Sandbox Next. CHANGELOG_BEGIN - [Sandbox] Fixed a bug in the command completions stream when running Sandbox in static time. Previously, upon updating the time, the old time was emitted on the completions stream. The new time is now emitted. CHANGELOG_END * sandbox: TimeServiceBackend should only emit accepted changes. * ledger-on-memory: Use `LedgerRecord` directly. * ledger-on-memory: Stream heartbeats to the log. * ledger-on-memory: Encapsulate mutations behind locks at all times. * ledger-on-memory: Differentiate between reading and writing. * ledger-on-memory: Factor out appending to the log. * kvutils: Move the heartbeat test into the base from ledger-on-memory. * kvutils: Log when the submission validation fails unexpectedly. * ledger-on-sql: Add a script to hash all migrations. * ledger-on-sql: Publish heartbeats to the log, and stream them out. * ledger-on-sql: Log if publishing the heartbeat failed. * ledger-on-sql: Wrap all queries in `Try`. Just to make sure that we don't throw from a function that returns `Try` or `Future`. * ledger-on-sql: Allow `Long` values as the heartbeat timestamp. `INTEGER` really does mean 32-bit, apparently. * sandbox-next: Pipe heartbeats to the ledger. * ledger-on-sql: Make sure we publish the correct head after a heartbeat. Off-by-one errors are the best errors. * ledger-on-(memory|sql): Just accept heartbeats, not their owner. * sandbox: Update CIDs in tests to account for the extra heartbeat. * ledger-on-memory: Fix a reference to variable in a comment. Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com> * ledger-on-sql: `flatMap` over `Try` rather than `Future` when possible. * sandbox: Make sure the heartbeat queues are thread-safe. * kvutils: Remove `LoggingContext` from the interfaces. Keep it internally. This means we'll drop any context, but otherwise things should work as expected. * sandbox-next: Pull out the heartbeat interval into a constant. * ledger-on-sql|sandbox: Clarify large levels of nesting. Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-02 22:44:42 +03:00
#!/usr/bin/env bash
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
Heartbeats for Sandbox-Next, ledger-on-sql, and ledger-on-memory. (#4755) * kvutils: Make the `KeyValueParticipantStateReader` tests more rigorous. If the `offset` is specified as `None`, expect it to be `None`, not just anything. * kvutils: Simplify `KeyValueParticipantStateReader#stateUpdates`. Construct the Source with `Source.apply`, not `Source.fromIterator`. * kvutils: Use multiple entry IDs in `KeyValueParticipantStateReaderSpec`. * kvutils: Add basic tests to `KeyValueParticipantStateReaderSpec`. * kvutils: Add heartbeats to `LedgerReader`'s `events` output. Heartbeats are optional, to be delivered by the ledger if and when it deems necessary. * sandbox-next: An observing time service backend using Akka streams. * sandbox-next: A regular heartbeat based on Akka Streams' `tick`. * sandbox: Replace `TimeServiceBackend.withObserver` with `.observing`. More code, but it's more decoupled, so can more easily be sent to the underlying backend in Sandbox Next. CHANGELOG_BEGIN - [Sandbox] Fixed a bug in the command completions stream when running Sandbox in static time. Previously, upon updating the time, the old time was emitted on the completions stream. The new time is now emitted. CHANGELOG_END * sandbox: TimeServiceBackend should only emit accepted changes. * ledger-on-memory: Use `LedgerRecord` directly. * ledger-on-memory: Stream heartbeats to the log. * ledger-on-memory: Encapsulate mutations behind locks at all times. * ledger-on-memory: Differentiate between reading and writing. * ledger-on-memory: Factor out appending to the log. * kvutils: Move the heartbeat test into the base from ledger-on-memory. * kvutils: Log when the submission validation fails unexpectedly. * ledger-on-sql: Add a script to hash all migrations. * ledger-on-sql: Publish heartbeats to the log, and stream them out. * ledger-on-sql: Log if publishing the heartbeat failed. * ledger-on-sql: Wrap all queries in `Try`. Just to make sure that we don't throw from a function that returns `Try` or `Future`. * ledger-on-sql: Allow `Long` values as the heartbeat timestamp. `INTEGER` really does mean 32-bit, apparently. * sandbox-next: Pipe heartbeats to the ledger. * ledger-on-sql: Make sure we publish the correct head after a heartbeat. Off-by-one errors are the best errors. * ledger-on-(memory|sql): Just accept heartbeats, not their owner. * sandbox: Update CIDs in tests to account for the extra heartbeat. * ledger-on-memory: Fix a reference to variable in a comment. Co-Authored-By: Gerolf Seitz <gerolf.seitz@digitalasset.com> * ledger-on-sql: `flatMap` over `Try` rather than `Future` when possible. * sandbox: Make sure the heartbeat queues are thread-safe. * kvutils: Remove `LoggingContext` from the interfaces. Keep it internally. This means we'll drop any context, but otherwise things should work as expected. * sandbox-next: Pull out the heartbeat interval into a constant. * ledger-on-sql|sandbox: Clarify large levels of nesting. Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-02 22:44:42 +03:00
# SPDX-License-Identifier: Apache-2.0
set -e
set -u
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
for file in "$DIR"/src/main/resources/com/daml/ledger/on/sql/migrations/**/*.sql; do
shasum -a 256 "$file" | awk '{ print $1 }' > "$file.sha256"
done