temporal icon indicating copy to clipboard operation
temporal copied to clipboard

temporal-cassandra-tool update schema fails if previous execution was aborted

Open nvtkaszpir opened this issue 3 years ago • 1 comments

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

  1. spawn cassandra, start invoking commands to create temporal setup schema and update schema
  2. abort command in the middle of the execition
  3. try to execute again
  4. see error logs and cry

Specifications

  • Version: 1.11.4
  • Platform: kubernetes

nvtkaszpir avatar Sep 27 '21 12:09 nvtkaszpir

Hello, has there been any update to this? Running into a similar problem and wanted to see how to resolve it.

brianlu-scale avatar Aug 16 '22 00:08 brianlu-scale

Will this be fixed?

jackingyu avatar Jul 25 '23 10:07 jackingyu

This is fixed as part of https://github.com/temporalio/temporal/pull/4761

yiminc avatar Aug 27 '23 17:08 yiminc