Skip to content

Commit 23c7ef0

Browse files
committed
chore(crdb): remove support for cockroach db from code base
Related to #4460
1 parent b48a2e3 commit 23c7ef0

File tree

112 files changed

+84
-6962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+84
-6962
lines changed

TESTING.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ There is a special profile for the WildFly Application Servers:
7575

7676
# Testing a Given Database
7777

78-
Camunda supports all database technologies listed on [Supported Database Products](https://docs.camunda.org/manual/latest/introduction/supported-environments/#supported-database-products), and in all environments, they are operating in as specified. Support means we guarantee the Camunda Platform integrates well with the database technology’s JDBC behavior (there are some [documented](https://docs.camunda.org/manual/latest/user-guide/process-engine/database/) limitations, e.g., isolation level `READ_COMMITTED` is required for all databases except CockroachDB, which in turns requires `SERIALIZABLE`). We test a database technology with a specific database, i.e., we test it in one environment, not all possible environments that you can imagine (e.g., we test Postgres on local Docker containers, but not as hosted databases on AWS or Azure).
78+
Camunda supports all database technologies listed on [Supported Database Products](https://docs.camunda.org/manual/latest/introduction/supported-environments/#supported-database-products), and in all environments, they are operating in as specified. Support means we guarantee the Camunda Platform integrates well with the database technology’s JDBC behavior (there are some [documented](https://docs.camunda.org/manual/latest/user-guide/process-engine/database/) limitations, e.g., isolation level `READ_COMMITTED` is required for all databases). We test a database technology with a specific database, i.e., we test it in one environment, not all possible environments that you can imagine (e.g., we test Postgres on local Docker containers, but not as hosted databases on AWS or Azure).
7979

8080
# No Maven? No problem!
8181

@@ -137,7 +137,6 @@ sure that the database image is configured according to [this guide](https://doc
137137
* PostgreSQL
138138
* MariaDB
139139
* MySQL
140-
* CockroachDB
141140
* MS-SQL 2017/2019 ([MSSQL-specific configuraion guide](https://docs.camunda.org/manual/latest/user-guide/process-engine/database/mssql-configuration/))
142141

143142
To execute the process engine test suite with a certain database (e.g. PostgreSQL), you should call Maven in the

database/pom.xml

-42
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
<version.postgresql>42.5.5</version.postgresql>
3030
<version.liquibase>4.8.0</version.liquibase>
3131

32-
<!-- CockroachDB is compatible with PostgreSQL 9.5,
33-
so a different version of the JDBC driver needs to be used -->
34-
<version.cockroachdb>42.2.9</version.cockroachdb>
35-
3632
<!-- needed for sql script and backward compatibility checks -->
3733
<camunda.version.old>7.21.0</camunda.version.old>
3834

@@ -383,44 +379,6 @@
383379
<was.liberty.datasource.filename>postgresql-xa-config.xml</was.liberty.datasource.filename>
384380
</properties>
385381
</profile>
386-
<profile>
387-
<id>cockroachdb</id>
388-
<properties>
389-
<database.type>cockroachdb</database.type>
390-
<database.driver>org.postgresql.Driver</database.driver>
391-
<database.datasource.class>org.postgresql.ds.PGSimpleDataSource</database.datasource.class>
392-
<jboss.datasource.filename>postgresql-ds.xml</jboss.datasource.filename>
393-
<hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</hibernate.dialect>
394-
<database.tc.url>camcockroachdb:20.1.3</database.tc.url>
395-
</properties>
396-
397-
<dependencies>
398-
<dependency>
399-
<groupId>org.postgresql</groupId>
400-
<artifactId>postgresql</artifactId>
401-
<version>${version.cockroachdb}</version>
402-
<scope>test</scope>
403-
</dependency>
404-
</dependencies>
405-
<build>
406-
<pluginManagement>
407-
<plugins>
408-
<plugin>
409-
<groupId>org.codehaus.mojo</groupId>
410-
<artifactId>sql-maven-plugin</artifactId>
411-
<dependencies>
412-
<dependency>
413-
<groupId>org.postgresql</groupId>
414-
<artifactId>postgresql</artifactId>
415-
<version>${version.cockroachdb}</version>
416-
</dependency>
417-
</dependencies>
418-
</plugin>
419-
</plugins>
420-
</pluginManagement>
421-
</build>
422-
</profile>
423-
424382
<profile>
425383
<id>sqlserver</id>
426384
<properties>

distro/sql-script/pom.xml

-17
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,6 @@
204204
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/create" files="activiti.postgres.create.engine.sql activiti.postgres.create.case.engine.sql activiti.postgres.create.decision.engine.sql activiti.postgres.create.history.sql activiti.postgres.create.case.history.sql activiti.postgres.create.decision.history.sql" />
205205
</concat>
206206

207-
<concat destfile="target/sql/create/cockroachdb_engine_${project.version}.sql" fixlastline="yes">
208-
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/create" files="activiti.cockroachdb.create.engine.sql activiti.cockroachdb.create.case.engine.sql activiti.cockroachdb.create.decision.engine.sql activiti.cockroachdb.create.history.sql activiti.cockroachdb.create.case.history.sql activiti.cockroachdb.create.decision.history.sql" />
209-
</concat>
210-
211207
<!-- add identity create files -->
212208
<copy todir="target/sql/create" flatten="false">
213209
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/create" />
@@ -250,10 +246,6 @@
250246
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/drop" files="activiti.postgres.drop.decision.engine.sql activiti.postgres.drop.case.engine.sql activiti.postgres.drop.engine.sql activiti.postgres.drop.decision.history.sql activiti.postgres.drop.case.history.sql activiti.postgres.drop.history.sql" />
251247
</concat>
252248

253-
<concat destfile="target/sql/drop/cockroachdb_engine_${project.version}.sql" fixlastline="yes">
254-
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/drop" files="activiti.cockroachdb.drop.decision.engine.sql activiti.cockroachdb.drop.case.engine.sql activiti.cockroachdb.drop.engine.sql activiti.cockroachdb.drop.decision.history.sql activiti.cockroachdb.drop.case.history.sql activiti.cockroachdb.drop.history.sql" />
255-
</concat>
256-
257249
<!-- add identity drop files -->
258250
<copy todir="target/sql/drop" flatten="false">
259251
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/drop" />
@@ -355,15 +347,6 @@
355347
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/upgrade" includes="postgres_engine_${camunda.old.majorVersion}.${camunda.old.minorVersion}_patch*.sql" />
356348
</concat>
357349

358-
<!-- cockroachdb patches -->
359-
<concat destfile="target/upgrade-test/sql/upgrade/cockroachdb_engine_${camunda.current.majorVersion}.${camunda.current.minorVersion}_patch.sql" fixlastline="yes">
360-
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/upgrade" includes="cockroachdb_engine_${camunda.current.majorVersion}.${camunda.current.minorVersion}_patch*.sql" />
361-
</concat>
362-
363-
<concat destfile="target/upgrade-test/sql/upgrade/cockroachdb_engine_${camunda.old.majorVersion}.${camunda.old.minorVersion}_patch.sql" fixlastline="yes">
364-
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/upgrade" includes="cockroachdb_engine_${camunda.old.majorVersion}.${camunda.old.minorVersion}_patch*.sql" />
365-
</concat>
366-
367350
<copy todir="target/upgrade-test/sql/upgrade">
368351
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/upgrade">
369352
<include name="*.sql" />

engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/SpringTransactionInterceptor.java

+3-24
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,11 @@
1616
*/
1717
package org.camunda.bpm.engine.spring;
1818

19-
import java.sql.SQLException;
20-
import java.util.logging.Logger;
21-
22-
import org.camunda.bpm.engine.impl.ProcessEngineLogger;
2319
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
24-
import org.camunda.bpm.engine.impl.db.sql.DbSqlSession;
2520
import org.camunda.bpm.engine.impl.interceptor.Command;
2621
import org.camunda.bpm.engine.impl.interceptor.CommandInterceptor;
2722
import org.camunda.bpm.engine.impl.util.ExceptionUtil;
2823
import org.springframework.transaction.PlatformTransactionManager;
29-
import org.springframework.transaction.TransactionStatus;
3024
import org.springframework.transaction.TransactionSystemException;
3125
import org.springframework.transaction.support.TransactionCallback;
3226
import org.springframework.transaction.support.TransactionTemplate;
@@ -42,13 +36,9 @@ public class SpringTransactionInterceptor extends CommandInterceptor {
4236
protected ProcessEngineConfigurationImpl processEngineConfiguration;
4337

4438
/**
45-
* This constructor doesn't pass an instance of the {@link ProcessEngineConfigurationImpl} class.
46-
* As a result, if it is used with CockroachDB, concurrency conflicts that occur on transaction
47-
* commit will not be handled by the process engine.
48-
*
4939
* @deprecated use the {@link #SpringTransactionInterceptor(PlatformTransactionManager, int, ProcessEngineConfigurationImpl)}
50-
* constructor to ensure that when used with CockroachDB, concurrency conflicts that occur
51-
* on transaction commit are detected and handled.
40+
* constructor to ensure that concurrency conflicts that occur on
41+
* transaction commit are detected and handled in all cases
5242
*/
5343
@Deprecated
5444
public SpringTransactionInterceptor(PlatformTransactionManager transactionManager, int transactionPropagation) {
@@ -71,18 +61,7 @@ public <T> T execute(final Command<T> command) {
7161
// don't use lambdas here => CAM-12810
7262
return (T) transactionTemplate.execute((TransactionCallback) status -> next.execute(command));
7363
} catch (TransactionSystemException ex) {
74-
// When CockroachDB is used, a CRDB concurrency error may occur on transaction commit.
75-
// To ensure that these errors are still detected as OLEs, we must catch them and wrap
76-
// them in a CrdbTransactionRetryException
77-
Throwable cause = ex.getCause();
78-
if (cause instanceof SQLException && processEngineConfiguration != null
79-
&& DbSqlSession.isCrdbConcurrencyConflictOnCommit((SQLException) cause, processEngineConfiguration)) {
80-
throw ProcessEngineLogger.PERSISTENCE_LOGGER.crdbTransactionRetryExceptionOnCommit(cause);
81-
82-
} else {
83-
throw ExceptionUtil.wrapPersistenceException(ex);
84-
85-
}
64+
throw ExceptionUtil.wrapPersistenceException(ex);
8665
}
8766
}
8867
}

engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/SpringTransactionsProcessEngineConfiguration.java

-11
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.camunda.bpm.engine.RepositoryService;
3030
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;
3131
import org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration;
32-
import org.camunda.bpm.engine.impl.db.sql.DbSqlSessionFactory;
3332
import org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor;
3433
import org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor;
3534
import org.camunda.bpm.engine.impl.interceptor.CommandInterceptor;
@@ -74,11 +73,6 @@ public ProcessEngine buildProcessEngine() {
7473
}
7574

7675
List<CommandInterceptor> defaultCommandInterceptorsTxRequired = new ArrayList<CommandInterceptor>();
77-
// CRDB interceptor is added before the SpringTransactionInterceptor,
78-
// so that a Spring TX may be rolled back before retrying.
79-
if (DbSqlSessionFactory.CRDB.equals(databaseType)) {
80-
defaultCommandInterceptorsTxRequired.add(getCrdbRetryInterceptor());
81-
}
8276
if (!isDisableExceptionCode()) {
8377
defaultCommandInterceptorsTxRequired.add(getExceptionCodeInterceptor());
8478
}
@@ -93,11 +87,6 @@ public ProcessEngine buildProcessEngine() {
9387

9488
protected Collection< ? extends CommandInterceptor> getDefaultCommandInterceptorsTxRequiresNew() {
9589
List<CommandInterceptor> defaultCommandInterceptorsTxRequiresNew = new ArrayList<CommandInterceptor>();
96-
// CRDB interceptor is added before the SpringTransactionInterceptor,
97-
// so that a Spring TX may be rolled back before retrying.
98-
if (DbSqlSessionFactory.CRDB.equals(databaseType)) {
99-
defaultCommandInterceptorsTxRequiresNew.add(getCrdbRetryInterceptor());
100-
}
10190
if (!isDisableExceptionCode()) {
10291
defaultCommandInterceptorsTxRequiresNew.add(getExceptionCodeInterceptor());
10392
}

engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/transaction/crdb/CrdbConcurrencyConflictDelegate.java

-57
This file was deleted.

engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/transaction/crdb/CrdbRetryInterceptorPlugin.java

-37
This file was deleted.

0 commit comments

Comments
 (0)