-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #289: Add alternative execution for counting queries in lock service #292
Conversation
src/main/java/liquibase/ext/cassandra/lockservice/LockServiceCassandra.java
Dismissed
Show dismissed
Hide dismissed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @maximevw !
@@ -62,19 +64,6 @@ public boolean acquireLock() throws LockException { | |||
// another node was faster | |||
return false; | |||
} | |||
if ((rowsUpdated == -1) && (database instanceof MSSQLDatabase)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for removing the trash here.
} | ||
try { | ||
return executor.queryForInt(new RawSqlStatement(query)); | ||
} catch (DatabaseException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice workaround!
As explained in the issue liquibase#289, the aggregate functions are not supported by AWS Keyspaces. This fix tries to execute counting queries and if it fails, the same query without the COUNT function is executed and the returned rows are counted programmatically. Also removes code specific to `MSSQLDatabase` in `LockServiceCassandra` obviously not related with Liquibase implementation for Cassandra.
205bb2e
to
f7f6802
Compare
Quality Gate passedIssues Measures |
As explained in the issue #289, the aggregate functions are not supported by AWS Keyspaces.
This fix tries to execute counting queries and if it fails, the same query without the COUNT
function is executed and the returned rows are counted programmatically.
Also removes code specific to
MSSQLDatabase
inLockServiceCassandra
obviously not relatedwith Liquibase implementation for Cassandra.