Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

failing drop table migration #17

@rintcius

Description

@rintcius

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:

Migration of keyspace cassandra_migration_test to version 1.0.0  - First
Migration of keyspace cassandra_migration_test to version 2.0.0  - Second
Migration of keyspace cassandra_migration_test to version 4.0.0  - Fourth
Exception in thread "main" com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency ONE (1 responses were required but only 0 replica responded, 1 failed)
    at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:85)
    at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:27)
    at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
    at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
    at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63)
    at com.builtamont.cassandra.migration.internal.dbsupport.SchemaVersionDAO.tablesExist(SchemaVersionDAO.java:146)
    at com.builtamont.cassandra.migration.internal.dbsupport.SchemaVersionDAO.findAppliedMigrations(SchemaVersionDAO.java:204)
    at com.builtamont.cassandra.migration.internal.info.MigrationInfoServiceImpl.refresh(MigrationInfoServiceImpl.kt:58)
    at com.builtamont.cassandra.migration.internal.command.Migrate.run(Migrate.kt:71)
    at com.builtamont.cassandra.migration.CassandraMigration$migrateAction$1.execute(CassandraMigration.kt:344)
    at com.builtamont.cassandra.migration.CassandraMigration$migrateAction$1.execute(CassandraMigration.kt:329)
    at com.builtamont.cassandra.migration.CassandraMigration.execute$cassandra_migration(CassandraMigration.kt:256)
    at com.builtamont.cassandra.migration.CassandraMigration.migrate(CassandraMigration.kt:122)
    at com.builtamont.cassandra.migration.CommandLine.main(CommandLine.kt:73)
Caused by: com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency ONE (1 responses were required but only 0 replica responded, 1 failed)
    at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:95)
    at com.datastax.driver.core.Responses$Error.asException(Responses.java:128)
    at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
    at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)
    at com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:43)
    at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:798)
    at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:617)
    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1005)
    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:928)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency ONE (1 responses were required but only 0 replica responded, 1 failed)
    at com.datastax.driver.core.Responses$Error$1.decode(Responses.java:76)
    at com.datastax.driver.core.Responses$Error$1.decode(Responses.java:37)
    at com.datastax.driver.core.Message$ProtocolDecoder.decode(Message.java:266)
    at com.datastax.driver.core.Message$ProtocolDecoder.decode(Message.java:246)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
    ... 14 more
runCmdTest(com.builtamont.cassandra.migration.CassandraMigrationIT)  Time elapsed: 11.807 sec  <<< FAILURE!
java.lang.AssertionError: 

Expected: is <true>
     but: was <false>
    at com.builtamont.cassandra.migration.CassandraMigrationIT.runCmdTest(CassandraMigrationIT.java:320)

Tests run: 8, Failures: 1, Errors: 5, Skipped: 0, Time elapsed: 73.368 sec <<< FAILURE! - in com.builtamont.cassandra.migration.CassandraMigrationIT

## Steps to Reproduce - Use branch https://github.com/rintcius/cassandra-migration/tree/issue_drop_table - run `mvn integration-test`

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions