Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.
This repository was archived by the owner on May 11, 2026. It is now read-only.

Cassalog can get into inconsistent state and prevent upgrades from completing #3

@jsanda

Description

@jsanda

When Cassalog applies a schema change, it executes whatever CQL statements correspond to the change, and then it updates the change log table, cassalog. If Cassalog fails to update the change log table, maybe due to a request timeout, Cassalog will abort. Depending on the schema change involved, Cassalog can wind up in an inconsistent state. Let's say we have:

schemaChange {
  version '1.0'
  author 'jsanda'
  cql """
CREATE TABLE my_table (
    id text PRIMARY KEY,
    value text
) WITH compaction = { 'class': 'LeveledCompactionStrategy' }
"""
}

Cassalog fails with a timeout exception while trying to update the change log table, or better yet, the JVM in which Cassalog is running gets shutdown abruptly. The next time Cassalog is run it will attempt to apply the above schema change since it was not recorded in the change log. This in turn will result in an error from Cassandra since the table already exists.

In this particular example we can sort of work around the problem by using CREATE TABLE my_table IF NOT EXISTS..., but that won't work in general. Initially I thought maybe the solution would be to use atomic batches, but they cannot be used with DDL statements. We need to figure something else out to prevent Cassalog from getting into an inconsistent state.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions