Cassandra Liquibase DB Migration
See original GitHub issueHello Team,
We are trying to use liquibase to do our db related changes in Cassandra when we are deploying our application components to GKP. We are trying to use liquibase for two things: a) Generating change log set:
When I try to execute below command it generated a nothing for a change log set and got below output:
$ java -jar liquibase-core.jar --classpath=driver.jar;liquibase-cassandra-4.2.1.jar;snakeyaml-1.12.jar --changeLogFile=dev/dbchangelog.xml --url=**********;DefaultKeyspace=*;UID=;PWD=&&&&&&&&&;SSLMode=1;UseSslIdentityCheck=0;AuthMech=1;SSLTruststorePath=I:\liquibasejar\app-dev1.jks;SSLTruststorePwd= --driver=com.simba.cassandra.jdbc42.Driver --defaultSchemaName= --logLevel=info generateChangeLog Mar 17, 2022 3:32:31 PM liquibase.servicelocator INFO: Cannot load service: liquibase.license.LicenseService: Provider liquibase.license.pro.DaticalTrueLicenseService could not be instantiated ####################################################
_ _ _ _
| | () () |
| | _ __ _ _ _ | |_ __ _ ___ ___
| | | |/ _ | | | | | '_ \ / _
/ __|/ _ \
| || | (| | || | | |) | (| _ \ __/
_/|_, |_,||./ _,|/__|
| |
|_|
Get documentation at docs.liquibase.com
Get certified courses at learn.liquibase.com
Free schema change activity reports at
https://hub.liquibase.com/
#################################################### Starting Liquibase at 15:32:31 (version 4.4.3 #53 built at 2021-08-05 18:32+0000) SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Mar 17, 2022 3:32:34 PM liquibase.snapshot WARNING: Did not find catalog ‘’ to snapshot Mar 17, 2022 3:32:34 PM liquibase.servicelocator INFO: Cannot load service: liquibase.serializer.ChangeLogSerializer: liquibase.serializer.core.json.JsonChangeLogSerializer Unable to get public no-arg constructor Mar 17, 2022 3:32:34 PM liquibase.servicelocator INFO: Cannot load service: liquibase.serializer.ChangeLogSerializer: liquibase.serializer.core.yaml.YamlChangeLogSerializer Unable to get public no-arg constructor Mar 17, 2022 3:32:34 PM liquibase.servicelocator INFO: Cannot load service: liquibase.serializer.ChangeLogSerializer: com.datical.liquibase.ext.diff.FormattedDiffSerializer Unable to get public no-arg constructor Mar 17, 2022 3:32:34 PM liquibase.diff INFO: changeSets count: 0 Mar 17, 2022 3:32:34 PM liquibase.diff INFO: No changesets to add. Generated changelog written to I:\liquibasejar\dev\dbchangelog.xml Liquibase command ‘generateChangeLog’ was executed successfully. I also tried to generate the changelog using below page by executing liquibase as a maven plug in: https://www.baeldung.com/liquibase-refactor-schema-of-java-app but still it says to change set and nothing diff to write upon db change log set.
b) Also using liquibase creates two tables in db after doing db related changes: a) Databasechangelog – this is to capture db related changes which is being applied by liquibase. b) Databasechangeloglock – this is table is used to acquire lock on db while performing changes. Both of these table are created automatically by liquibase in DB if they are not present. We want these tables to have custom names rather than default name. So in our liquibase configurations, we are passing hard coded values for custom table names as of now. liquibase.setDatabaseChangeLogTable(“VQCHANGELOG”); liquibase.setDatabaseChangeLogLockTable(“VQCHANGELOGLOCK”);
When we deploy this change to GKP, we are getting below error in our pod which says unconfigured table for lock:
2022-03-21 18:37:00.858 INFO 1 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 3 endpoint(s) beneath base path '/actuator'
2022-03-21 18:37:00.960 INFO 1 — [ main] c.j.c.e.q.virtual.config.AsyncConfig : Configuring AsyncTaskExecutor [taskExecutor] for [virtualQualificationAsyncTaskExecutor]… 2022-03-21 18:37:00.967 INFO 1 — [ main] c.j.c.e.q.virtual.config.AsyncConfig : Configuring AsyncTaskExecutor [mvcTaskExecutor] for [MvcVirtualQualificationAsyncTaskExecutor]… 2022-03-21 18:37:01.013 INFO 1 — [ main] .c.p.g.l.m.r.KafkaListenerRestController : kafka Listener rest controller active. 2022-03-21 18:37:01.154 INFO 1 — [ main] c.j.c.e.q.v.c.LiquibaseConfiguration : Retrieving database change log table name : VQCHANGELOG 2022-03-21 18:37:01.154 INFO 1 — [ main] c.j.c.e.q.v.c.LiquibaseConfiguration : Retrieving database change log lock table name : VQCHANGELOGLOCK 2022-03-21 18:37:02.994 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:13.905 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:24.809 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:35.743 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:46.636 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:37:57.539 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:08.385 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:19.284 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:30.200 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:41.071 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:38:51.917 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:02.816 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:13.702 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:24.675 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:35.543 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:46.445 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:39:57.314 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:08.180 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:19.056 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:29.972 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:40.871 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:40:51.805 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:02.794 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:13.655 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:24.515 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:35.405 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:46.254 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:41:57.166 INFO 1 — [ main] liquibase.ext : Waiting for changelog lock… 2022-03-21 18:42:08.059 WARN 1 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘liquibase’ defined in class path resource [com/qualification/virtual/config/LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM ewallet_dev1.VQCHANGELOGLOCK WHERE ID=1: [Simba]CassandraJDBCDriver ERROR Invalid query: SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM ewallet_dev1.VQCHANGELOGLOCK WHERE ID=1, Cause: com.simba.cassandra.shaded.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table vqchangeloglock.
Kindly check these and suggest us if we are missing some thing or come config that needs to be corrected. Any help is greatly appreciated.
Additional detail:
Liquibase Version: 4.4.3 Liquibase Integration & Version: Spring boot Liquibase Extension(s) & Version: Database Vendor & Version: Cassandra 3.11 Operating System Type & Version: Linux **************-7d77b9cb84-kgxzw 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Aug 31 20:15:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Thanks. Himanshu.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
@kataggart : As soon as I can get some info on this, I will schedule the zoom call for 30 mins. Thank you so much for the help 😃
@lanevska thanks for the heads up on that PR over on the extension repo. I will see what we might be able to do.