From 9546fe06ce783d054c6fcfc36bb82517615ac358 Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Mon, 16 Dec 2024 21:35:59 +0100 Subject: [PATCH 1/3] Add pg_anon to spec if PG version is not 17 instead of deleting --- .../compute_wrapper/var/db/postgres/specs/spec.json | 5 ----- docker-compose/docker_compose_test.sh | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docker-compose/compute_wrapper/var/db/postgres/specs/spec.json b/docker-compose/compute_wrapper/var/db/postgres/specs/spec.json index 8e582e74e15d..0308cab4515a 100644 --- a/docker-compose/compute_wrapper/var/db/postgres/specs/spec.json +++ b/docker-compose/compute_wrapper/var/db/postgres/specs/spec.json @@ -132,11 +132,6 @@ "name": "cron.database", "value": "postgres", "vartype": "string" - }, - { - "name": "session_preload_libraries", - "value": "anon", - "vartype": "string" } ] }, diff --git a/docker-compose/docker_compose_test.sh b/docker-compose/docker_compose_test.sh index c97dfaa901e8..1dfebc5264e2 100755 --- a/docker-compose/docker_compose_test.sh +++ b/docker-compose/docker_compose_test.sh @@ -36,10 +36,10 @@ for pg_version in ${TEST_VERSION_ONLY-14 15 16 17}; do cleanup PG_TEST_VERSION=$((pg_version < 16 ? 16 : pg_version)) # The support of pg_anon not yet added to PG17, so we have to remove the corresponding option - if [ $pg_version -eq 17 ]; then + if [ "${pg_version}" -ne 17 ]; then SPEC_PATH="compute_wrapper/var/db/postgres/specs" mv $SPEC_PATH/spec.json $SPEC_PATH/spec.bak - jq 'del(.cluster.settings[] | select (.name == "session_preload_libraries"))' $SPEC_PATH/spec.bak > $SPEC_PATH/spec.json + jq '.cluster.settings += [{"name": "session_preload_libraries","value": "anon","vartype": "string"}]' "${SPEC_PATH}/spec.bak" > "${SPEC_PATH}/spec.json" fi PG_VERSION=$pg_version PG_TEST_VERSION=$PG_TEST_VERSION docker compose --profile test-extensions -f $COMPOSE_FILE up --build -d @@ -107,7 +107,7 @@ for pg_version in ${TEST_VERSION_ONLY-14 15 16 17}; do fi cleanup # The support of pg_anon not yet added to PG17, so we have to remove the corresponding option - if [ $pg_version -eq 17 ]; then - mv $SPEC_PATH/spec.bak $SPEC_PATH/spec.json + if [ "$pg_version" -ne 17 ]; then + mv "$SPEC_PATH/spec.bak" "$SPEC_PATH/spec.json" fi done From ef0ede2e1671c77a1736d2bca9d9d4ef39f721f8 Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Mon, 16 Dec 2024 22:24:23 +0100 Subject: [PATCH 2/3] fix the comments --- docker-compose/docker_compose_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose/docker_compose_test.sh b/docker-compose/docker_compose_test.sh index 1dfebc5264e2..7c4e19f55c1d 100755 --- a/docker-compose/docker_compose_test.sh +++ b/docker-compose/docker_compose_test.sh @@ -35,7 +35,7 @@ for pg_version in ${TEST_VERSION_ONLY-14 15 16 17}; do echo "clean up containers if exists" cleanup PG_TEST_VERSION=$((pg_version < 16 ? 16 : pg_version)) - # The support of pg_anon not yet added to PG17, so we have to remove the corresponding option + # The support of pg_anon not yet added to PG17, so we have to add the corresponding option if [ "${pg_version}" -ne 17 ]; then SPEC_PATH="compute_wrapper/var/db/postgres/specs" mv $SPEC_PATH/spec.json $SPEC_PATH/spec.bak @@ -106,7 +106,7 @@ for pg_version in ${TEST_VERSION_ONLY-14 15 16 17}; do fi fi cleanup - # The support of pg_anon not yet added to PG17, so we have to remove the corresponding option + # Restore the original spec.json if [ "$pg_version" -ne 17 ]; then mv "$SPEC_PATH/spec.bak" "$SPEC_PATH/spec.json" fi From e857d7dc98744fe9011351b098d6e931c1cbbe85 Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Mon, 16 Dec 2024 22:25:40 +0100 Subject: [PATCH 3/3] fix the comments --- docker-compose/docker_compose_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/docker_compose_test.sh b/docker-compose/docker_compose_test.sh index 7c4e19f55c1d..063664d0c67d 100755 --- a/docker-compose/docker_compose_test.sh +++ b/docker-compose/docker_compose_test.sh @@ -35,7 +35,7 @@ for pg_version in ${TEST_VERSION_ONLY-14 15 16 17}; do echo "clean up containers if exists" cleanup PG_TEST_VERSION=$((pg_version < 16 ? 16 : pg_version)) - # The support of pg_anon not yet added to PG17, so we have to add the corresponding option + # The support of pg_anon not yet added to PG17, so we have to add the corresponding option for other PG versions if [ "${pg_version}" -ne 17 ]; then SPEC_PATH="compute_wrapper/var/db/postgres/specs" mv $SPEC_PATH/spec.json $SPEC_PATH/spec.bak