You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor peristence layer to support inserting history tasks of new categories (#6671)
**Detailed Description**
Introduce data and data_encoding columns to the executions table of Cassandra. These field are used to replace other columns in `executions` table. We'll start by replacing the history task columns (`transfer`, `timer` and `replication`).
**Impact Analysis**
- **Backward Compatibility**: Yes. It only changes the schema, no data is written to the new columns in this PR.
- **Forward Compatibility**: Yes. It only changes the schema, no data is written to the new columns in this PR.
**Testing Plan**
- **Unit Tests**: Yes.
- **Persistence Tests**: No. The code implementation is not fully done in this PR.
- **Integration Tests**: No.
- **Compatibility Tests**: No.
**Rollout Plan**
- What is the rollout plan? No special rollout plan.
- Does the order of deployment matter? Doesn't matter.
- Is it safe to rollback? Does the order of rollback matter? Yes. The order doesn't matter.
- Is there a kill switch to mitigate the impact immediately? No.
<!-- Describe what has changed in this PR -->
**What changed?**
- Introduce `data` and `data_encoding` columns to the executions table of Cassandra. (NOTE: no data is written to Cassandra in this PR, it will be introduced in a separate PR)
- Refactor persistence data type to replace transfer tasks, timer tasks, and replication tasks with tasksByCategory map of tasks
- Remove cross cluster tasks logic from persistence layer
<!-- Tell your future self why have you made these changes -->
**Why?**
- The new columns will be used to store data in `executions` table. A migration is required later to migrate transfer, timer and replication tasks data from their corresponding columns to `data` and `data_encoding` columns. The migration will be done in several phases:
1. Dual writes: data is written in both `transfer/timer/replication` column and `data`, `data_encoding` columns
2. Read from old columns
3. Read from new columns
Several other migrations will be initiated to migrate data from other columns of other types to these 2 columns.
- The refactoring is to make it easier to introduce new categories of history tasks.
- Cross cluster task is deprecated.
- This change should only affect cadence-history
<!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? -->
**How did you test it?**
Unit tests
<!-- Assuming the worst case, what can be broken when deploying this change to production? -->
**Potential risks**
<!-- Is it notable for release? e.g. schema updates, configuration or data migration required? If so, please mention it, and also update CHANGELOG.md -->
**Release notes**
<!-- Is there any documentation updates should be made for config, https://cadenceworkflow.io/docs/operation-guide/setup/ ? If so, please open an PR in https://github.com/cadence-workflow/cadence-docs -->
**Documentation Changes**
0 commit comments