citus/src/backend/distributed/sql/downgrades
Jelte Fennema-Nio 110b4192b2
Fix PG upgrades when invalid rebalance strategies exist (#7580)
DESCRIPTION: Fix PG upgrades when invalid rebalance strategies exist

Without this change an upgrade of a cluster with an invalid rebalance
strategy would fail with an error like this:
```
cache lookup failed for shard_cost_function with oid 6077337
CONTEXT:  SQL statement "SELECT citus_validate_rebalance_strategy_functions(
        NEW.shard_cost_function,
        NEW.node_capacity_function,
        NEW.shard_allowed_on_node_function)"
PL/pgSQL function citus_internal.pg_dist_rebalance_strategy_trigger_func() line 5 at PERFORM
SQL statement "INSERT INTO pg_catalog.pg_dist_rebalance_strategy SELECT
        name,
        default_strategy,
        shard_cost_function::regprocedure::regproc,
        node_capacity_function::regprocedure::regproc,
        shard_allowed_on_node_function::regprocedure::regproc,
        default_threshold,
        minimum_threshold,
        improvement_threshold
    FROM public.pg_dist_rebalance_strategy"
PL/pgSQL function citus_finish_pg_upgrade() line 115 at SQL statement
```

This fixes that by disabling the trigger and simply re-inserting the
invalid rebalance strategy without checking. We could also silently
remove it, but this seems nicer.
2024-04-15 14:26:33 +00:00
..
citus--9.2-4--9.2-2.sql Introduce new make targets for downgrade scripts 2020-07-14 13:10:18 +03:00
citus--9.3-2--9.2-4.sql Introduce new make targets for downgrade scripts 2020-07-14 13:10:18 +03:00
citus--9.4-1--9.3-2.sql Introduce new make targets for downgrade scripts 2020-07-14 13:10:18 +03:00
citus--9.5-1--9.4-1.sql Create sequence dependency during metadata syncing 2020-10-06 10:57:39 +02:00
citus--10.0-4--9.5-1.sql Prevent C-style comments in all directories (#5250) 2021-09-09 11:54:58 +03:00
citus--10.1-1--10.0-4.sql Remove public schema dependency for 10.1 upgrades 2021-07-09 02:08:22 +03:00
citus--10.2-1--10.1-1.sql Fixes bug about int and smallint sequences on MX (#5254) 2021-09-09 23:41:07 +03:00
citus--10.2-2--10.2-1.sql Revoke read access to columnar.chunk from unprivileged user (#5313) 2021-09-22 16:23:02 +03:00
citus--10.2-3--10.2-2.sql Make (columnar.stripe) first_row_number index a unique constraint (#5324) 2021-09-30 10:51:56 +03:00
citus--10.2-4--10.2-3.sql Introduce dependencies from columnarAM to columnar metadata objects 2021-11-23 13:14:00 +03:00
citus--11.0-1--10.2-4.sql Introduces citus_coordinator_node_id 2022-03-22 10:34:22 +03:00
citus--11.0-2--11.0-1.sql Fix downgrade scripts from 11.0-2 to 11.0-1 (#6039) 2022-06-29 22:43:50 +03:00
citus--11.0-3--11.0-2.sql Fixes a bug that prevents upgrades when there are no worker nodes 2022-06-28 15:54:49 +02:00
citus--11.1-1--11.0-4.sql Drop SHARD_STATE_TO_DELETE (#6494) 2023-01-03 14:38:16 +03:00
citus--11.2-1--11.1-1.sql Remove shardstate from placement insert functions (#6615) 2023-01-18 09:52:38 +01:00
citus--11.2-2--11.2-1.sql Add upgrade/downgrade paths between v11.2.2 and v11.3.1 (#6820) 2023-04-06 12:46:09 +03:00
citus--11.3-1--11.2-2.sql Adds control for background task executors involving a node (#6771) 2023-04-06 14:12:39 +03:00
citus--11.3-2--11.3-1.sql Move SQL file changes for citus_shard_sizes fixes into the new 11.3-2 version (#7050) 2023-07-14 17:19:54 +03:00
citus--12.0-1--11.3-2.sql Move SQL file changes for citus_shard_sizes fixes into the new 11.3-2 version (#7050) 2023-07-14 17:19:54 +03:00
citus--12.1-1--12.0-1.sql Add citus_schema_move() function (#7180) 2023-09-08 12:03:53 +03:00
citus--12.2-1--12.1-1.sql Fix PG upgrades when invalid rebalance strategies exist (#7580) 2024-04-15 14:26:33 +00:00