-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align Postgres workflow_id
Column with Cassandra
#6520
Align Postgres workflow_id
Column with Cassandra
#6520
Conversation
workflow_id
from varchar 255 to text in postgresqlworkflow_id
Column with Cassandra
62d6382
to
9fe00aa
Compare
9fe00aa
to
127edea
Compare
@@ -467,11 +467,11 @@ func TestListBatchJobs(t *testing.T) { | |||
expectedOutput: []map[string]string{ | |||
{ | |||
"jobID": "example-workflow-1", | |||
"startTime": "1970-01-01T00:00:01Z", | |||
"startTime": "1970-01-01T01:00:01+01:00", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this is just a temporary patch to ensure POSTGRES=1 make test
works locally for me and will likely be excluded in the final changes. I will just keep this change temporarily, only to show what worked for me. Furthermore, this has nothing to do with the other changes in this PR, as I have verified that the issue persist in the master branch.
This reverts commit 127edea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once schema files are updated, thanks for your work on this!
@@ -0,0 +1,19 @@ | |||
ALTER TABLE executions ALTER workflow_id TYPE text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update cadence/schema.sql and visibility/schema.sql to reflect these changes? During first time setup we run only the schema files, the versions are used only when an existing cluster is upgraded. The schema files should match the outcome of running all the version upgrades.
What changed?
The
workflow_id
column in the PostgreSQL schema has been updated fromVARCHAR(255)
toTEXT
, removing the 255-character limit and aligning it with Cassandra’s schema, which allows longer workflow identifiers.Why?
The 255-character limit restricted how much context we could include in workflow identifiers, which was limiting in certain cases. Updating the column to
TEXT
aligns PostgreSQL with Cassandra (reference) and allows higher-level enforcement of length restrictions if needed.How did you test it?
POSTGRES=1 make test
has been run successfully with some minor adjustments.Potential risks
Release notes
workflow_id
column in PostgreSQL now usesTEXT
instead ofVARCHAR(255)
.Documentation Changes
Not sure if documentation is needed, since these changes will make the PostgreSQL schema more aligned with the Cassandra schema.
Detailed Description
These changes relax the constraints on the
workflow_id
columns and should not cause issues during upgrades.Impact Analysis
workflow_id
values remain within the previous 255-character limit. If any exceed this limit, users would have already encountered errors in PostgreSQL.workflow_id
values may need to monitor memory usage, storage, and performance.Testing Plan
workflow_id
values longer than 255 characters could be added but may not be necessary.workflow_id
values, downgrades will require truncating those IDs manually. This scenario is rare, and users can handle it themselves if needed.Rollout Plan
What is the rollout plan?
Rollout as usual.
Does the order of deployment matter?
No, even if
cadence_visibility
still uses the old schema, it should still work since oldworkflow_id
s should be covered by the old column typeVARCHAR(255)
Is it safe to rollback?
Should be safe to rollback, unless
workflow_id
configuration has been changed, resulting in ids exceeding 255 character limit.Does the order of rollback matter?
Not to my knowledge.
Is there a kill switch to mitigate the impact immediately?
Should not be necessary.