Freeze on precondition about indexes
See original GitHub issueI am unsing the 3.6.3 version of liquibase on an Oracle database.
When i use the index pre condition Liquibase is freezing and the freez can take more than one hour…
Here is my changeLog
<?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.6.xsd"
logicalFilePath="master-cleva">
<changeSet author="cleva" id="abe_1" labels="Create index IND_HRI_BPP_TYPO_BPB" logicalFilePath="master-cleva">
<preConditions onFail="MARK_RAN" onFailMessage="Index IND_HRI_BPP_TYPO_BPB already exists.">
<not>
<indexExists indexName="IND_HRI_BPP_TYPO_BPB" />
</not>
</preConditions>
<comment></comment>
<createIndex indexName="IND_HRI_BPP_TYPO_BPB" tableName="F_HISTO_RIB" unique="false">
<column name="HRI_PTRBPPIDENT" type="NUMBER(14)" />
<column name="HRI_PTRTYPOIDENT" type="NUMBER(14)" />
<column name="HRI_PTRBPBIDENT" type="NUMBER(14)" />
</createIndex>
</changeSet>
<changeSet author="cleva" id="abe_2" labels="Create index IND_SOR_PTRSORID_SOUSCRIPTION" logicalFilePath="master-cleva">
<preConditions onFail="MARK_RAN" onFailMessage="Index IND_SOR_PTRSORID_SOUSCRIPTION already exists.">
<not>
<indexExists indexName="IND_SOR_PTRSORID_SOUSCRIPTION" />
</not>
</preConditions>
<comment></comment>
<createIndex indexName="IND_SOR_PTRSORID_SOUSCRIPTION" tableName="F_SIT_OBJET_RISQUE" unique="false">
<column name="SOR_PTRSORID_SOUSCRIPTION" type="NUMBER(14)" />
</createIndex>
</changeSet>
<changeSet author="cleva" id="abe_3" labels="Create index IND_MVT_PTRPOL_NON_REGULARISE" logicalFilePath="master-cleva">
<preConditions onFail="MARK_RAN" onFailMessage="Index IND_MVT_PTRPOL_NON_REGULARISE already exists.">
<not>
<indexExists indexName="IND_MVT_PTRPOL_NON_REGULARISE" />
</not>
</preConditions>
<comment></comment>
<createIndex indexName="IND_MVT_PTRPOL_NON_REGULARISE" tableName="F_MOUVEMENT" unique="false">
<column name="MVT_PTRPOLID" type="NUMBER(14)" />
<column name="MVT_NON_REGULARISE" type="VARCHAR(1)" />
</createIndex>
</changeSet>
</databaseChangeLog>
Here the stack trace (freezing on the select index request )
Thread [main] (Suspended)
owns: T4CConnection (id=201)
SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: not available [native method]
SocketInputStream.socketRead(FileDescriptor, byte[], int, int, int) line: 116
SocketInputStream.read(byte[], int, int, int) line: 171
SocketInputStream.read(byte[], int, int) line: 141
DataPacket(Packet).receive() line: 311
DataPacket.receive() line: 105
NetInputStream.getNextPacket() line: 305
NetInputStream.read(byte[], int, int) line: 249
NetInputStream.read(byte[]) line: 171
NetInputStream.read() line: 89
T4CSocketInputStreamWrapper.readNextPacket() line: 123
T4CSocketInputStreamWrapper.read() line: 79
T4CMAREngineStream.unmarshalUB1() line: 426
T4C8Oall(T4CTTIfun).receive() line: 390
T4C8Oall(T4CTTIfun).doRPC() line: 249
T4C8Oall.doOALL(boolean, boolean, boolean, boolean, boolean, OracleStatement$SqlKind, int, byte[], int, Accessor[], int, Accessor[], int, byte[], char[], short[], int, DBConversion, byte[], InputStream[][], byte[][][], OracleTypeADT[][], OracleStatement, byte[], char[], short[], T4CTTIoac[], int[], int[], int[], NTFDCNRegistration) line: 566
T4CStatement.doOall8(boolean, boolean, boolean, boolean, boolean, int) line: 202
T4CStatement.doOall8(boolean, boolean, boolean, boolean, boolean) line: 45
T4CStatement.executeForRows(boolean) line: 933
T4CStatement(OracleStatement).executeMaybeDescribe() line: 929
T4CStatement(OracleStatement).doExecuteWithTimeout() line: 1034
T4CStatement(OracleStatement).executeQuery(String) line: 1244
OracleStatementWrapper.executeQuery(String) line: 420
JdbcDatabaseSnapshot$CachingDatabaseMetaData$2(ResultSetCache$ResultSetExtractor).executeAndExtract(String, Database, boolean) line: 255
JdbcDatabaseSnapshot$CachingDatabaseMetaData$2(ResultSetCache$ResultSetExtractor).executeAndExtract(String, Database) line: 242
JdbcDatabaseSnapshot$CachingDatabaseMetaData$2.fastFetch() line: 387
JdbcDatabaseSnapshot$CachingDatabaseMetaData$2.bulkFetch() line: 490
ResultSetCache.get(ResultSetExtractor) line: 59
JdbcDatabaseSnapshot$CachingDatabaseMetaData.getIndexInfo(String, String, String, String) line: 318
IndexSnapshotGenerator.snapshotObject(DatabaseObject, DatabaseSnapshot) line: 161
IndexSnapshotGenerator(JdbcSnapshotGenerator).snapshot(DatabaseObject, DatabaseSnapshot, SnapshotGeneratorChain) line: 66
SnapshotGeneratorChain.snapshot(T, DatabaseSnapshot) line: 49
ColumnSnapshotGeneratorOracle(JdbcSnapshotGenerator).snapshot(DatabaseObject, DatabaseSnapshot, SnapshotGeneratorChain) line: 69
SnapshotGeneratorChain.snapshot(T, DatabaseSnapshot) line: 49
JdbcDatabaseSnapshot(DatabaseSnapshot).include(T) line: 286
JdbcDatabaseSnapshot(DatabaseSnapshot).replaceObject(Object) line: 407
JdbcDatabaseSnapshot(DatabaseSnapshot).includeNestedObjects(DatabaseObject) line: 334
JdbcDatabaseSnapshot(DatabaseSnapshot).include(T) line: 309
JdbcDatabaseSnapshot(DatabaseSnapshot).replaceObject(Object) line: 407
JdbcDatabaseSnapshot(DatabaseSnapshot).replaceObject(Object) line: 429
JdbcDatabaseSnapshot(DatabaseSnapshot).includeNestedObjects(DatabaseObject) line: 334
JdbcDatabaseSnapshot(DatabaseSnapshot).include(T) line: 309
JdbcDatabaseSnapshot(DatabaseSnapshot).init(DatabaseObject[]) line: 102
JdbcDatabaseSnapshot(DatabaseSnapshot).<init>(DatabaseObject[], Database, SnapshotControl) line: 59
JdbcDatabaseSnapshot.<init>(DatabaseObject[], Database, SnapshotControl) line: 38
SnapshotGeneratorFactory.createSnapshot(DatabaseObject[], Database, SnapshotControl) line: 217
SnapshotGeneratorFactory.createSnapshot(CatalogAndSchema[], Database, SnapshotControl) line: 190
SnapshotGeneratorFactory.createSnapshot(CatalogAndSchema, Database, SnapshotControl) line: 157
SnapshotGeneratorFactory.has(DatabaseObject, Database) line: 144
IndexExistsPrecondition.check(Database, DatabaseChangeLog, ChangeSet, ChangeExecListener) line: 103
NotPrecondition.check(Database, DatabaseChangeLog, ChangeSet, ChangeExecListener) line: 40
PreconditionContainer(AndPrecondition).check(Database, DatabaseChangeLog, ChangeSet, ChangeExecListener) line: 45
PreconditionContainer.check(Database, DatabaseChangeLog, ChangeSet, ChangeExecListener) line: 215
ChangeSet.execute(DatabaseChangeLog, ChangeExecListener, Database) line: 516
UpdateVisitor.visit(ChangeSet, DatabaseChangeLog, Database, Set<ChangeSetFilterResult>) line: 53
ChangeLogIterator.run(ChangeSetVisitor, RuntimeEnvironment) line: 83
Liquibase.update(Contexts, LabelExpression, boolean) line: 202
Liquibase.update(Contexts, LabelExpression) line: 179
Liquibase.update(String, Contexts, LabelExpression) line: 334
LiquibaseUpdate.doUpdate(Liquibase) line: 33
LiquibaseUpdate(AbstractLiquibaseUpdateMojo).performLiquibaseTask(Liquibase) line: 30
LiquibaseUpdate(AbstractLiquibaseMojo).execute() line: 366
DefaultBuildPluginManager.executeMojo(MavenSession, MojoExecution) line: 134
MojoExecutor.execute(MavenSession, MojoExecution, ProjectIndex, DependencyContext) line: 207
MojoExecutor.execute(MavenSession, MojoExecution, ProjectIndex, DependencyContext, PhaseRecorder) line: 153
MojoExecutor.execute(MavenSession, List<MojoExecution>, ProjectIndex) line: 145
LifecycleModuleBuilder.buildProject(MavenSession, MavenSession, ReactorContext, MavenProject, TaskSegment) line: 116
LifecycleModuleBuilder.buildProject(MavenSession, ReactorContext, MavenProject, TaskSegment) line: 80
SingleThreadedBuilder.build(MavenSession, ReactorContext, ProjectBuildList, List<TaskSegment>, ReactorBuildStatus) line: 51
LifecycleStarter.execute(MavenSession) line: 128
DefaultMaven.doExecute(MavenExecutionRequest, MavenSession, MavenExecutionResult, DefaultRepositorySystemSession) line: 307
DefaultMaven.doExecute(MavenExecutionRequest) line: 193
DefaultMaven.execute(MavenExecutionRequest) line: 106
MavenCli.execute(CliRequest) line: 863
MavenCli.doMain(CliRequest) line: 288
MavenCli.main(String[], ClassWorld) line: 199
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
Launcher.launchEnhanced(String[]) line: 289
Launcher.launch(String[]) line: 229
Launcher.mainWithExitCode(String[]) line: 415
Launcher.main(String[]) line: 356
My output console is
[DEBUG] Computed checksum for 8:f8aaf837475588c187baf059caa66da5: as bc55ef347f1f7684590a93dfc5666107
[DEBUG] Running Changeset:master-cleva::abe_1::cleva
[DEBUG] Changeset master-cleva::abe_1::cleva
[DEBUG] Excluding ABR_CLEVA.T_MVT_NATURE.NMV_PTRPASID
[DEBUG] Excluding ABR_CLEVA.T_MVT_NATURE.NMV_IDENT
Did somebody had the same problem?
Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Freeze on precondition about indexes · Issue #212 - GitHub
When i use the index pre condition Liquibase is freezing and the freez can take more than one hour.. Here is my changeLog....
Read more >Index Precondition performance on ORACLE - Liquibase Forum
Hello,. I am unsing the 3.6.3 version of liquibase on an Oracle database. When i use the index pre condition Liquibase is freezing...
Read more >Liquibase Slowness When Creating Indexes - Stack Overflow
On this environment, I am trying to execute a huge changelog file where I create tables and indices. Find below a small part...
Read more >Babeltrace 2 C API: API fundamentals
A frozen object is immutable: trying to set an object's property once it's frozen represents a precondition break. For example, the library freezes...
Read more >Creating frozen indices with the Elasticsearch Freeze index API
As a best practice, before you freeze an index it's recommended to first run a force_merge. This will ensure that each shard has...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
➤ Mike Olivas commented:
Hi Matthew. I am not sure of the why in the history but I like your workaround and will find out what I can on the why.
In ran into a similar issue, but the problem also got worse from version 4.0 onwards. For example, while on version 3.4 it took around 4 seconds for a changeset to run with indexExists condition, on 4.0 for the same changeset it takes around 5 minutes.