docs/cassandra-executions-table.md
The executions table in Cassandra is a table used for storing mutiple types of entities, because Cassandra doesn't support cross-table LWTs.
The type column in executions table indicates the type of entity stored in that row. Since the table stores all the entities, the columns
are the union set of columns of all entities. And the data in each column have different meaning for different type of entities. We'll explain
for each type of entity the usage of the columns in executions table.
The shard entities are the rows with type=0, which stores the information of Cadence shards. The following columns are used:
shard_id: the id of the Cadence shardtype: indicates the type of entity, which is always 0 for shardshard: stores the information of shardrange_id: used to manage changes to the shard's configuration and ownershipOther columns are set to a constant only because they're part of primary key columns:
domain_id: 10000000-1000-f000-f000-000000000000workflow_id: 20000000-1000-f000-f000-000000000000run_id: 30000000-1000-f000-f000-000000000000visibility_ts: 2000-01-01 00:00:00.000000+0000task_id: -11The execution entities are the rows with type=1, which stores the information of workflow. And there are 2 types of executions: current_execution and concrete_execution.
The current_execution entities has a constant value in the run_id column which equals 30000000-0000-f000-f000-000000000001. The follwing columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entitydomain_id: the id of the domain of the workflowworkflow_id: the id of the workflowcurrent_run_id: the run_id of the most recent workflow among the workflows with the same workflow_idexecution: stores some information about the workflowworkflow_last_write_version: the failover version of the workflow last updated by a Cadence clusterworkflow_state: the state of the workflowThe following columns are set to a constant value:
run_id: 30000000-0000-f000-f000-000000000001visibility_ts: 2000-01-01 00:00:00.000000+0000task_id: -10The concrete_execution entities stores the information of each run of a workflow. These columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entitydomain_id: the id of the domain of the workflowworkflow_id: the id of the workflowrun_id: the id of the instance of the workflowexecution: stores some information about the workflownext_event_id: the id of the next event of the workflowactivity_map: the information of activities of the workflowtimer_map: the information of timers of the workflowchild_executions_map: the information of child workflows of the workflowrequest_cancel_map: the information of cancellation requests of the workflowsignal_map: the information of signals applied to the workflowsignal_requested: the ids of the signals applied to the workflowbuffered_events_list: the buffered events of the workflowworkflow_last_write_version: the failover version of the workflow last updated by a Cadence clusterworkflow_state: the state of the workflowversion_histories: stores the information tracking the version history of the workflowversion_histories_encoding: the encoding type of version_histories columnchecksum: a piece of data used for detecting data corruption in databaseThe following columns are set to a constant value:
visibility_ts: 2000-01-01 00:00:00.000000+0000task_id: -10The transfer_task entities are the rows with type=2. The following columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entitytask_id: the id of the tasktransfer: the information of the taskThe following columns are set to a constant value:
domain_id: 10000000-3000-f000-f000-000000000000workflow_id: 20000000-3000-f000-f000-000000000000run_id: 30000000-3000-f000-f000-000000000000visibility_ts: 2000-01-01 00:00:00.000000+0000The timer_task entities are the rows with type=3. The following columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entityvisibility_ts: the timestamp of the timer tasktask_id: the id of the tasktimer: the information of the taskThe following columns are set to a constant value:
domain_id: 10000000-4000-f000-f000-000000000000workflow_id: 20000000-4000-f000-f000-000000000000run_id: 30000000-4000-f000-f000-000000000000The replication_task entities are the rows with type=4. The following columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entitytask_id: the id of the taskreplication: the information of the taskThe following columns are set to a constant value:
domain_id: 10000000-5000-f000-f000-000000000000workflow_id: 20000000-5000-f000-f000-000000000000run_id: 30000000-5000-f000-f000-000000000000visibility_ts: 2000-01-01 00:00:00.000000+0000The dlq entities are the rows with type=5. The following columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entityworkflow_id: the source cluster of the replication tasktask_id: the id of the taskreplication: the information of the taskThe following columns are set to a constant value:
domain_id: 10000000-6000-f000-f000-000000000000run_id: 30000000-6000-f000-f000-000000000000visibility_ts: 2000-01-01 00:00:00.000000+0000The cross_cluster_task entities are the rows with type=6. The following columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entityworkflow_id: the target cluster which the task is applied totask_id: the id of the taskcross_cluster: the information of the taskThe following columns are set to a constant value:
domain_id: 10000000-7000-f000-f000-000000000000run_id: 30000000-7000-f000-f000-000000000000visibility_ts: 2000-01-01 00:00:00.000000+0000The workflow_requests entities are rows with type in {7, 8, 9, 10}. The following columns are set:
shard_id: the id of the Cadence shardtype: indicates the type of the entity (7 = StartWorkflowRequest, 8 = SignalWorkflowRequest, 9 = CancelWorkflowRequest, 10 = ResetWorkflowRequest)domain_id: the id of the domainworkflow_id: the id of the workflow which the request is applied torun_id: the id of the requesttask_id: the failover version of the domain when the request is appliedcurrent_run_id: the run_id of the workflow which the request is applied to
The following columns are set to a constant value:visibility_ts: 2000-01-01 00:00:00.000000+0000