vfsoraki
vfsoraki

Reputation: 2307

Cassandra refuses to run query with where clause

I have 2 Cassandra nodes. I have a table with 3 text fields (all keys) and 2 counters. RF is 2.

I added another counter column to table. Mistakenly, I issued drop on that column. I reverted application back to old version to not use the column.

I have added another counter column, to replace the dropped one, with a different name. I changed application to use that new column.

Now, all my queries that have where clause fail with this error:

ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] message="Operation failed - received 0 responses and 2 failures" info={'failures': 2, 'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}

And I see this in debug.log:

java.lang.IllegalStateException: [payable, revenue, to_pay, value] is not a subset of [revenue to_pay value]

payable is the old column, that was dropped, and to_pay is the new column.

What is happening?

Cassandra version is 3.11.

PS. I tried repairing, and it is running. Will it help?

EDIT:

Table schema:

CREATE TABLE backend_platform_prod.stats_counters (
    date text,
    key text,
    revenue counter,
    to_pay counter,
    value counter,
    PRIMARY KEY (date, key)
) WITH CLUSTERING ORDER BY (key ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

There was a payable counter field, that is dropped.

I tried backing up data with copy to, dropping table and recreating it, and restoring with copy from. It is working now, although some data seems missing (not very important).

I see payable column in system_schema.dropped_columns, but not in system_schema.columns.

Upvotes: 2

Views: 251

Answers (1)

user6238251
user6238251

Reputation: 66

Please check in System_schema keyspace .if the column is still existing delete that row.

Upvotes: 0

Related Questions