HHH-15245 update the CockroachDB docker config

Applied recommended CockroachDB settings for single-node testing.
This commit is contained in:
Karel Maesen 2022-05-03 21:48:00 +02:00 committed by Christian Beikov
parent 93f1c0401d
commit 9e69f5fd4c
1 changed files with 16 additions and 3 deletions

View File

@ -476,16 +476,29 @@ hana() {
cockroachdb() { cockroachdb() {
$CONTAINER_CLI rm -f cockroach || true $CONTAINER_CLI rm -f cockroach || true
$CONTAINER_CLI run -d --name=cockroach -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v20.2.4 start-single-node --insecure $CONTAINER_CLI run -d --name=cockroach -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v21.2.10 start-single-node \
--insecure --store=type=mem,size=0.25 --advertise-addr=localhost
OUTPUT= OUTPUT=
while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do
echo "Waiting for CockroachDB to start..." echo "Waiting for CockroachDB to start..."
sleep 10 sleep 10
OUTPUT=$($CONTAINER_CLI logs cockroach) # Note we need to redirect stderr to stdout to capture the logs
OUTPUT=$($CONTAINER_CLI logs cockroach 2>&1)
done done
echo "Enabling experimental box2d operators" echo "Enabling experimental box2d operators and some ptimized 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 -it cockroach bash -c "cat <<EOF | ./cockroach sql --insecure $CONTAINER_CLI exec -it cockroach bash -c "cat <<EOF | ./cockroach sql --insecure
SET CLUSTER SETTING sql.spatial.experimental_box2d_comparison_operators.enabled = on; 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';
ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 5;
ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 5;
quit quit
EOF EOF
" "