Configuration
I am using Spring Boot 2.3.2.RELEASE with Liquibase on the classpath.
build.gradle 6.4.1:
id 'org.liquibase.gradle' version '2.0.4'
implementation 'org.liquibase:liquibase-core:4.0.0'
application.properties:
spring.liquibase.changeLog=classpath:db/changelog/db.changelog-master.xml
spring.liquibase.user=username
spring.liquibase.password=password
db.changelog-master.xml
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<preConditions>
<dbms type="oracle"/>
</preConditions>
<include file="db/changelog/db.changelog-1.0.oracle.sql"/>
</databaseChangeLog>
db.changelog-1.0.oracle.sql:
My sql file has only 8 changesets, which has all been ran previously(nothing new to run), such as:
--liquibase formatted sql
--changeset author:date-1
--preconditions onFail:MARK_RAN
--precondition-sql-check expectedResult:0 SELECT count(*) FROM user_tables WHERE table_name = 'XXX';
SQL 1;
:
DATABASECHANGELOG table has the expected 8 entries.
Issue
I face a delay issue occasionally, especially when i just start STS 4.5.1 IDE(connecting remotely to the DB via VPN), but when the application is rerun/restarted i do not face it anymore until some future time. I am not able to be more precise or reproduce the issue at will.
As such, i have set logging.level.liquibase=DEBUG, and this is where the delay is happening:
Log with delay(~4 minutes)
:
2020-07-27 12:55:33,015 [restartedMain] DEBUG liquibase.servicelocator - Loaded liquibase.diff.compare.DatabaseObjectComparator instance com.datical.liquibase.ext.storedlogic.checkconstraint.CheckConstraintComparator2020-07-27 <<<12:55:33,019>>> [restartedMain] DEBUG liquibase.util - Computed checksum for 1595825733018 as 2349116d802a7d8314d3cced0b6e2f95
2020-07-27 <<<12:59:29,948>>> [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor2020-07-27 12:59:29,966 [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor
2020-07-27 12:59:29,975 [restartedMain] INFO liquibase.changelog - Reading from XXX.DATABASECHANGELOG
2020-07-27 12:59:29,976 [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor
2020-07-27 12:59:30,188 [restartedMain] DEBUG liquibase.util - Computed checksum for inputStream as 69be88e5a0af937fcecaeb79fb44811d
Log with no delay(~ 4 seconds)
In normal times:
:
2020-07-27 13:12:04,672 [restartedMain] DEBUG liquibase.servicelocator - Loaded liquibase.diff.compare.DatabaseObjectComparator instance com.datical.liquibase.ext.storedlogic.StoredLogicComparator 2020-07-27 13:12:04,673 [restartedMain] DEBUG liquibase.servicelocator - Loaded liquibase.diff.compare.DatabaseObjectComparator instance com.datical.liquibase.ext.storedlogic.checkconstraint.CheckConstraintComparator2020-07-27 <<<13:12:04,676>>> [restartedMain] DEBUG liquibase.util - Computed checksum for 1595826724675 as 56c113e10add546ca00dadcb20c71635
2020-07-27 <<<13:12:08,966>>> [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor2020-07-27 13:12:08,979 [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor
2020-07-27 13:12:08,988 [restartedMain] INFO liquibase.changelog - Reading from XXX.DATABASECHANGELOG
2020-07-27 13:12:08,988 [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor
2020-07-27 13:12:09,031 [restartedMain] DEBUG liquibase.util - Computed checksum for inputStream as 69be88e5a0af937fcecaeb79fb44811d
Any hint as to where the delay is coming from is appreciated.
EDIT 1
After posting the question, it made me realize that i do not need this plugin:
id 'org.liquibase.gradle' version '2.0.4'
I have no idea if this is the cause of the delay, but i have just removed it.
EDIT 2
The ~4 minutes delay is not because of the plugin, it is still happening:
2020-07-29 08:49:06,074 [restartedMain] DEBUG liquibase.util - Computed checksum for 1595983746073 as 431beddb3aa3ca2d61f0c8b37185ae04
2020-07-29 08:53:14,902 [restartedMain] DEBUG liquibase.executor - Executing with the 'jdbc' executor