-
Notifications
You must be signed in to change notification settings - Fork 22
failing drop table migration #17
Comments
Thanks @rintcius , I've managed to reproduce the problem. Will have a look into it. |
@rintcius I've noticed that I can reproduce this problem consistently with embedded Cassandra, but not (yet) with a standalone Cassandra. Can you tell me a bit more about your cluster setup (where the migrations fail)? Whatever info you can share will be helpful. Note: |
@hhandoko I'm using Cassandra 3.7, single node |
@rintcius so I've done some more investigation: It's failing for embedded Cassandra and Apache Cassandra 3.7, but OK [1] for Apache Cassandra 3.8 and 3.9, and DSEC 3.0. Will continue to investigate to find potential solution(s), and I'm also working on a Vagrant script to make it easy to create different Cassandra VMs (distribution and/or versions) for similar issues in the future. Notes: |
@rintcius this branch (WIP) has the Vagrantfile if you wish to check your migration script against different Cassandra distributions and/or versions. Define |
@hhandoko Good to hear that it is solved in 3.8/3.9. Thanks for looking into it! |
I've narrowed down the problem to one particular query to check whether the One solution is to change from I don't have any historical context, but possibly it was done the way it is for efficiency (count rows, rather than retrieve all rows). It looks safe to change as its only purpose is to check whether the table exists, if it becomes a problem it can be changed in the future. Another alternative is to query Cassandra's More info: Statement schemaVersionCountsStatement = QueryBuilder
.select()
.countAll()
.from(keyspaceConfig.getName(), tableName + COUNTS_TABLE_NAME_SUFFIX); which generates: SELECT count(*)
FROM cassandra_migration_test.cassandra_migration_version_counts; |
@rintcius I've made a PR with a supposed fix for your issue. Let me know what you think. |
@hhandoko Great! Looks good to me. |
Address upstream PR hhandoko#17
Some of my migrations fail when it contains a
drop table
. Not sure why it fails for some scenarios and succeeds for other (but at least it seems to fail consistently when it fails).In this branch I have made some changes which fail for me.
Expected Behaviour
mvn integration-test
should succeed## Actual Behaviour
mvn integration-test
fails with these kind of exceptions:## Steps to Reproduce - Use branch https://github.com/rintcius/cassandra-migration/tree/issue_drop_table - run `mvn integration-test`
The text was updated successfully, but these errors were encountered: