mirror of https://github.com/citusdata/citus.git
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.
|
||
|---|---|---|
| .. | ||
| citus--9.2-4--9.2-2.sql | ||
| citus--9.3-2--9.2-4.sql | ||
| citus--9.4-1--9.3-2.sql | ||
| citus--9.5-1--9.4-1.sql | ||
| citus--10.0-4--9.5-1.sql | ||
| citus--10.1-1--10.0-4.sql | ||
| citus--10.2-1--10.1-1.sql | ||
| citus--10.2-2--10.2-1.sql | ||
| citus--10.2-3--10.2-2.sql | ||
| citus--10.2-4--10.2-3.sql | ||
| citus--11.0-1--10.2-4.sql | ||
| citus--11.0-2--11.0-1.sql | ||
| citus--11.0-3--11.0-2.sql | ||
| citus--11.1-1--11.0-4.sql | ||
| citus--11.2-1--11.1-1.sql | ||
| citus--11.2-2--11.2-1.sql | ||
| citus--11.3-1--11.2-2.sql | ||
| citus--11.3-2--11.3-1.sql | ||
| citus--12.0-1--11.3-2.sql | ||
| citus--12.1-1--12.0-1.sql | ||
| citus--12.2-1--12.1-1.sql | ||