diff --git a/.circleci/server-upgrade-downgrade/run.sh b/.circleci/server-upgrade-downgrade/run.sh index 1d8284a9b02..c65cdda9c72 100755 --- a/.circleci/server-upgrade-downgrade/run.sh +++ b/.circleci/server-upgrade-downgrade/run.sh @@ -154,9 +154,16 @@ get_server_upgrade_tests() { cd $RELEASE_PYTEST_DIR tmpfile="$(mktemp --dry-run)" set -x + # NOTE: any tests deselected in run_server_upgrade_pytest need to be filtered out here too + # # FIX ME: Deselecting some introspection tests and event trigger tests from the previous test suite # which throw errors on the latest build. Even when the output of the current build is more accurate. # Remove these deselects after the next stable release + # + # NOTE: test_events.py involves presistent state and probably isn't + # feasible to run here + # FIXME: re-enable test_graphql_queries.py::TestGraphQLQueryFunctions + # (fixing "already exists" error) if possible python3 -m pytest -q --collect-only --collect-upgrade-tests-to-file "$tmpfile" \ -m 'allow_server_upgrade_test and not skip_server_upgrade_test' \ --deselect test_schema_stitching.py::TestRemoteSchemaBasic::test_introspection \ @@ -170,6 +177,8 @@ get_server_upgrade_tests() { --deselect test_events.py::TestUpdateEvtQuery::test_update_basic \ --deselect test_schema_stitching.py::TestAddRemoteSchemaTbls::test_add_schema \ --deselect test_schema_stitching.py::TestAddRemoteSchemaTbls::test_add_conflicting_table \ + --deselect test_events.py \ + --deselect test_graphql_queries.py::TestGraphQLQueryFunctions \ "${args[@]}" 1>/dev/null 2>/dev/null set +x cat "$tmpfile" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c371ea3037..61c79ade1a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Next release (Add entries below in the order of server, console, cli, docs, others) +- server: fix resetting metadata catalog version to 43 while initializing postgres source with v1.0 catalog + ## v2.0.1 diff --git a/server/src-rsr/migrations/43_to_44.sql b/server/src-rsr/migrations/43_to_44.sql index 1092b6de8b7..02aa4ee4331 100644 --- a/server/src-rsr/migrations/43_to_44.sql +++ b/server/src-rsr/migrations/43_to_44.sql @@ -1,5 +1,13 @@ -- This migration adds versioning to metadata, used for optimistic locking in UIs. -- TODO: Are there changes required in catalog_versions.txt -ALTER TABLE hdb_catalog.hdb_metadata -ADD COLUMN IF NOT EXISTS "resource_version" INTEGER NOT NULL DEFAULT 1 UNIQUE; +DO $$ + BEGIN + BEGIN + ALTER TABLE hdb_catalog.hdb_metadata ADD COLUMN "resource_version" INTEGER NOT NULL DEFAULT 1 UNIQUE; + EXCEPTION + -- For pg 9.6 compatibility + WHEN duplicate_column THEN RAISE NOTICE 'column resource_version already exists in hdb_metadata'; + END; + END; +$$