HHH-17093 - Remove support for CockroachDB versions older than 22.2
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
83a1fa7f56
commit
0ded30a157
87
docker_db.sh
87
docker_db.sh
|
@ -931,92 +931,6 @@ EOF
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cockroachdb_22_1() {
|
|
||||||
$CONTAINER_CLI rm -f cockroach || true
|
|
||||||
LOG_CONFIG="
|
|
||||||
sinks:
|
|
||||||
stderr:
|
|
||||||
channels: all
|
|
||||||
filter: ERROR
|
|
||||||
redact: false
|
|
||||||
exit-on-error: true
|
|
||||||
"
|
|
||||||
$CONTAINER_CLI run -d --name=cockroach -m 6g -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v22.1.13 start-single-node \
|
|
||||||
--insecure --store=type=mem,size=0.25 --advertise-addr=localhost --log="$LOG_CONFIG"
|
|
||||||
OUTPUT=
|
|
||||||
while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do
|
|
||||||
echo "Waiting for CockroachDB to start..."
|
|
||||||
sleep 10
|
|
||||||
# Note we need to redirect stderr to stdout to capture the logs
|
|
||||||
OUTPUT=$($CONTAINER_CLI logs cockroach 2>&1)
|
|
||||||
done
|
|
||||||
echo "Enabling experimental box2d operators and some optimized settings for running the tests"
|
|
||||||
#settings documented in https://www.cockroachlabs.com/docs/v22.1/local-testing.html#use-a-local-single-node-cluster-with-in-memory-storage
|
|
||||||
$CONTAINER_CLI exec cockroach bash -c "cat <<EOF | ./cockroach sql --insecure
|
|
||||||
SET CLUSTER SETTING sql.spatial.experimental_box2d_comparison_operators.enabled = on;
|
|
||||||
SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = true;
|
|
||||||
SET CLUSTER SETTING kv.range_merge.queue_interval = '50ms';
|
|
||||||
SET CLUSTER SETTING jobs.registry.interval.gc = '30s';
|
|
||||||
SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';
|
|
||||||
SET CLUSTER SETTING jobs.retention_time = '15s';
|
|
||||||
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
|
|
||||||
SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';
|
|
||||||
ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 600;
|
|
||||||
ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 600;
|
|
||||||
SET CLUSTER SETTING sql.defaults.serial_normalization=sql_sequence;
|
|
||||||
|
|
||||||
quit
|
|
||||||
EOF
|
|
||||||
"
|
|
||||||
echo "Cockroachdb successfully started"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cockroachdb_21_2() {
|
|
||||||
$CONTAINER_CLI rm -f cockroach || true
|
|
||||||
LOG_CONFIG="
|
|
||||||
sinks:
|
|
||||||
stderr:
|
|
||||||
channels: all
|
|
||||||
filter: ERROR
|
|
||||||
redact: false
|
|
||||||
exit-on-error: true
|
|
||||||
"
|
|
||||||
$CONTAINER_CLI run -d --name=cockroach -m 6g -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v21.2.16 start-single-node \
|
|
||||||
--insecure --store=type=mem,size=640MiB --advertise-addr=localhost --log="$LOG_CONFIG"
|
|
||||||
OUTPUT=
|
|
||||||
while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do
|
|
||||||
echo "Waiting for CockroachDB to start..."
|
|
||||||
sleep 10
|
|
||||||
# Note we need to redirect stderr to stdout to capture the logs
|
|
||||||
OUTPUT=$($CONTAINER_CLI logs cockroach 2>&1)
|
|
||||||
done
|
|
||||||
echo "Enabling experimental box2d operators and some optimized settings for running the tests"
|
|
||||||
#settings documented in https://www.cockroachlabs.com/docs/v21.2/local-testing.html#use-a-local-single-node-cluster-with-in-memory-storage
|
|
||||||
$CONTAINER_CLI exec cockroach bash -c "cat <<EOF | ./cockroach sql --insecure
|
|
||||||
SET CLUSTER SETTING sql.spatial.experimental_box2d_comparison_operators.enabled = on;
|
|
||||||
SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = true;
|
|
||||||
SET CLUSTER SETTING kv.range_merge.queue_interval = '50ms';
|
|
||||||
SET CLUSTER SETTING jobs.registry.interval.gc = '30s';
|
|
||||||
SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';
|
|
||||||
SET CLUSTER SETTING jobs.retention_time = '15s';
|
|
||||||
SET CLUSTER SETTING schemachanger.backfiller.buffer_increment = '128 KiB';
|
|
||||||
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
|
|
||||||
SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';
|
|
||||||
SET CLUSTER SETTING timeseries.storage.enabled = false;
|
|
||||||
SET CLUSTER SETTING timeseries.storage.resolution_10s.ttl = '0s';
|
|
||||||
SET CLUSTER SETTING timeseries.storage.resolution_30m.ttl = '0s';
|
|
||||||
ALTER RANGE default CONFIGURE ZONE USING \"gc.ttlseconds\" = 10;
|
|
||||||
ALTER DATABASE system CONFIGURE ZONE USING \"gc.ttlseconds\" = 10;
|
|
||||||
ALTER DATABASE defaultdb CONFIGURE ZONE USING \"gc.ttlseconds\" = 10;
|
|
||||||
SET CLUSTER SETTING sql.defaults.serial_normalization=sql_sequence;
|
|
||||||
quit
|
|
||||||
EOF
|
|
||||||
"
|
|
||||||
echo "Cockroachdb successfully started"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
tidb() {
|
tidb() {
|
||||||
tidb_5_1
|
tidb_5_1
|
||||||
}
|
}
|
||||||
|
@ -1051,7 +965,6 @@ if [ -z ${1} ]; then
|
||||||
echo -e "\tcockroachdb"
|
echo -e "\tcockroachdb"
|
||||||
echo -e "\tcockroachdb_23_1"
|
echo -e "\tcockroachdb_23_1"
|
||||||
echo -e "\tcockroachdb_22_2"
|
echo -e "\tcockroachdb_22_2"
|
||||||
echo -e "\tcockroachdb_22_1"
|
|
||||||
echo -e "\tdb2"
|
echo -e "\tdb2"
|
||||||
echo -e "\tdb2_11_5"
|
echo -e "\tdb2_11_5"
|
||||||
echo -e "\tdb2_10_5"
|
echo -e "\tdb2_10_5"
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class CockroachDialect extends Dialect {
|
||||||
// Pre-compile and reuse pattern
|
// Pre-compile and reuse pattern
|
||||||
private static final Pattern CRDB_VERSION_PATTERN = Pattern.compile( "v[\\d]+(\\.[\\d]+)?(\\.[\\d]+)?" );
|
private static final Pattern CRDB_VERSION_PATTERN = Pattern.compile( "v[\\d]+(\\.[\\d]+)?(\\.[\\d]+)?" );
|
||||||
|
|
||||||
protected static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 22, 1 );
|
protected static final DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 22, 2 );
|
||||||
|
|
||||||
protected final PostgreSQLDriverKind driverKind;
|
protected final PostgreSQLDriverKind driverKind;
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ public class CockroachDialect extends Dialect {
|
||||||
functionContributions.getFunctionRegistry().register(
|
functionContributions.getFunctionRegistry().register(
|
||||||
"trunc",
|
"trunc",
|
||||||
new PostgreSQLTruncFunction(
|
new PostgreSQLTruncFunction(
|
||||||
getVersion().isSameOrAfter( 22, 2 ),
|
true,
|
||||||
functionContributions.getTypeConfiguration()
|
functionContributions.getTypeConfiguration()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue