temporal
temporal copied to clipboard
temporal-cassandra-tool update schema fails if previous execution was aborted
Expected Behavior
temporal-cassandra-tool update would work even if previous exetutions were aborted, This means temporal-cassandra-tool queries should be idempotent.
Actual Behavior
if previous execution was aborted then temporal-cassandra-tool execution will end with error.
bash-5.0$ temporal-cassandra-tool -k temporal update -schema-dir /etc/temporal/schema/cassandra/temporal/versioned
2021/09/27 12:49:23 validating connection to cassandra cluster
2021/09/27 12:49:23 connection validation succeeded
2021/09/27 12:49:23 UpdateSchemeTask started, config=&{DBName: TargetVersion: SchemaDir:/etc/temporal/schema/cassandra/temporal/versioned IsDryRun:false}
2021/09/27 12:49:23 ---- Executing updates for version 1.0 ----
2021/09/27 12:49:23 CREATE TYPE serialized_event_batch (encoding_type text,version int,data blob,);
2021/09/27 12:49:23 error executing statement:A user type of name temporal.serialized_event_batch already exists
Suggested fix
Change CREATE TYPE
to CREATE TYPE IF NOT EXISTS
Steps to Reproduce the Problem
- spawn cassandra, start invoking commands to create temporal setup schema and update schema
- abort command in the middle of the execition
- try to execute again
- see error logs and cry
Specifications
- Version: 1.11.4
- Platform: kubernetes
Hello, has there been any update to this? Running into a similar problem and wanted to see how to resolve it.
Will this be fixed?
This is fixed as part of https://github.com/temporalio/temporal/pull/4761