Skip to content

Commit

Permalink
Merge pull request #6 from alex-dixon/temporal-1.21.2
Browse files Browse the repository at this point in the history
Temporal 1.21.2
  • Loading branch information
mpenick authored Jul 15, 2023
2 parents d68f74d + f1f6a3e commit 6b241de
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ CQL_PROXY_VERSION=0.1.2
ELASTICSEARCH_VERSION=7.16.2
MYSQL_VERSION=8
POSTGRESQL_VERSION=13
TEMPORAL_VERSION=1.17.4
TEMPORAL_VERSION=1.21.2
TEMPORAL_WEB_VERSION=1.15.0
TEMPORAL_UI_VERSION=2.5.1
TEMPORAL_UI_VERSION=2.16.1
14 changes: 7 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ services:
- temporal-network
stdin_open: true
tty: true
temporal-web:
container_name: temporal-web
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_GRPC_ENDPOINT=temporal:7233
- TEMPORAL_PERMIT_WRITE_API=true
image: temporalio/web:${TEMPORAL_WEB_VERSION}
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:${TEMPORAL_UI_VERSION}
networks:
- temporal-network
ports:
- 8088:8088
- 8080:8080
networks:
temporal-network:
driver: bridge
name: temporal-network
name: temporal-network
50 changes: 29 additions & 21 deletions schema/cassandra/temporal/schema.cql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TYPE serialized_event_batch (
encoding_type text,
version int,
data blob,
data blob
);

CREATE TABLE executions (
Expand All @@ -27,8 +27,8 @@ CREATE TABLE executions (
timer_encoding text,
visibility_task_data blob,
visibility_task_encoding text,
tiered_storage_task_data blob,
tiered_storage_task_encoding text,
task_data blob,
task_encoding text,
next_event_id bigint, -- This is needed to make conditional updates on session history
range_id bigint, -- Increasing sequence identifier for transfer queue, checkpointed into shard info
activity_map map<bigint, blob>,
Expand All @@ -54,13 +54,13 @@ CREATE TABLE executions (
};

CREATE TABLE history_node (
tree_id uuid,
branch_id uuid,
node_id bigint, -- node_id: first eventID in a batch of events
txn_id bigint, -- for override the same node_id: bigger txn_id wins
prev_txn_id bigint, -- pointing to the previous node: event chaining
data blob, -- Batch of workflow execution history events as a blob
data_encoding text, -- Protocol used for history serialization
tree_id uuid, -- run_id if no reset, otherwise run_id of first run
branch_id uuid, -- changes in case of reset workflow. Conflict resolution can also change branch id.
node_id bigint, -- == first eventID in a batch of events
txn_id bigint, -- in case of multiple transactions on same node, we utilize highest transaction ID. Unique.
prev_txn_id bigint, -- point to the previous node: event chaining
data blob, -- batch of workflow execution history events as a blob
data_encoding text, -- protocol used for history serialization
PRIMARY KEY ((tree_id), branch_id, node_id, txn_id )
) WITH CLUSTERING ORDER BY (branch_id ASC, node_id ASC, txn_id DESC)
AND COMPACTION = {
Expand Down Expand Up @@ -94,6 +94,25 @@ CREATE TABLE tasks (
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
};

-- Stores task queue information such as user provided versioning data
-- OR
-- Used as a mapping from build id to task queue
CREATE TABLE task_queue_user_data (
namespace_id uuid,
task_queue_name text,
build_id text, -- If this row is used as a mapping of build id to task queue, this will not be empty
data blob, -- temporal.server.api.persistence.v1.TaskQueueUserData
data_encoding text, -- Encoding type used for serialization, in practice this should always be proto3
version bigint, -- Version of this row, used for optimistic concurrency
-- task_queue_name is not a part of the parititioning key to allow cheaply iterating all task queues in a single
-- namespace. Access to this table should be infrequent enough that a single partition per namespace can be used.
-- Note that this imposes a limit on total task queue user data within one namespace (see the relevant single
-- partition Cassandra limits).
PRIMARY KEY ((namespace_id), build_id, task_queue_name)
) WITH COMPACTION = {
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
};

-- this table is only used for storage of mapping of namespace uuid to namespace name
CREATE TABLE namespaces_by_id (
id uuid,
Expand Down Expand Up @@ -138,17 +157,6 @@ CREATE TABLE queue (
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
};

-- TODO deprecate this table in v1.15+
CREATE TABLE cluster_metadata (
metadata_partition int,
data blob,
data_encoding text,
version bigint,
PRIMARY KEY (metadata_partition)
) WITH COMPACTION = {
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
};

CREATE TABLE cluster_metadata_info (
metadata_partition int,
cluster_name text,
Expand Down
6 changes: 6 additions & 0 deletions schema/cassandra/temporal/versioned/v1.8/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"CurrVersion": "1.8",
"MinCompatibleVersion": "1.0",
"Description": "add storage for update records and create task_queue_user_data table",
"SchemaUpdateCqlFiles": ["task_queue_user_data.cql"]
}
18 changes: 18 additions & 0 deletions schema/cassandra/temporal/versioned/v1.8/task_queue_user_data.cql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Stores task queue information such as user provided versioning data
-- OR
-- Used as a mapping from build id to task queue
CREATE TABLE task_queue_user_data (
namespace_id uuid,
task_queue_name text,
build_id text, -- If this row is used as a mapping of build id to task queue, this will not be empty
data blob, -- temporal.server.api.persistence.v1.TaskQueueUserData
data_encoding text, -- Encoding type used for serialization, in practice this should always be proto3
version bigint, -- Version of this row, used for optimistic concurrency
-- task_queue_name is not a part of the parititioning key to allow cheaply iterating all task queues in a single
-- namespace. Access to this table should be infrequent enough that a single partition per namespace can be used.
-- Note that this imposes a limit on total task queue user data within one namespace (see the relevant single
-- partition Cassandra limits).
PRIMARY KEY ((namespace_id), build_id, task_queue_name)
) WITH COMPACTION = {
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
};

0 comments on commit 6b241de

Please sign in to comment.