Files
mastermanuandGitHub c017e28c91 Change default order for listClosedWorkflowExecutions to by close time #312 (#555)
This PR removes:
- The option to switch between V1 and V2 Persistence Visibility stores (V1 was the default)
- The V2 Cassandra Persistence Visibility Store (merged it with the V1 store).
- The V1 tables in Cassandra itself

As a result, running tctl wf list now returns closed workflows ordered by their closed time in a descending order as mentioned in this issue: #312
2020-07-20 14:12:46 -07:00

49 lines
1.8 KiB
Cassandra CQL

CREATE TABLE open_executions (
namespace_id uuid,
namespace_partition int,
workflow_id text,
run_id uuid,
start_time timestamp,
execution_time timestamp,
workflow_type_name text,
memo blob,
encoding text,
task_queue text,
PRIMARY KEY ((namespace_id, namespace_partition), start_time, run_id)
) WITH CLUSTERING ORDER BY (start_time DESC)
AND COMPACTION = {
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy',
'tombstone_threshold': 0.6
}
AND GC_GRACE_SECONDS = 60;
CREATE INDEX open_by_workflow_id ON open_executions (workflow_id);
CREATE INDEX open_by_type ON open_executions (workflow_type_name);
CREATE TABLE closed_executions (
namespace_id uuid,
namespace_partition int,
workflow_id text,
run_id uuid,
start_time timestamp,
execution_time timestamp,
close_time timestamp,
status int, -- enum WorkflowExecutionStatus {COMPLETED, FAILED, CANCELED, TERMINATED, CONTINUED_AS_NEW, TIMED_OUT}
workflow_type_name text,
history_length bigint,
memo blob,
encoding text,
task_queue text,
PRIMARY KEY ((namespace_id, namespace_partition), close_time, run_id)
) WITH CLUSTERING ORDER BY (close_time DESC)
AND COMPACTION = {
'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
}
AND GC_GRACE_SECONDS = 172800;
CREATE INDEX closed_by_workflow_id ON closed_executions (workflow_id);
CREATE INDEX closed_by_close_time ON closed_executions (close_time);
CREATE INDEX closed_by_type ON closed_executions (workflow_type_name);
CREATE INDEX closed_by_status ON closed_executions (status);