From be28ba8e70ad163c202a09afa1b25d50c0a1b20b Mon Sep 17 00:00:00 2001 From: velioglu Date: Mon, 13 Nov 2017 11:43:18 +0300 Subject: [PATCH] Add stub UDF to run pg_upgrade flawlessly --- .../distributed/master/master_node_protocol.c | 42 +++++++++++++++++++ src/include/distributed/master_protocol.h | 3 ++ 2 files changed, 45 insertions(+) diff --git a/src/backend/distributed/master/master_node_protocol.c b/src/backend/distributed/master/master_node_protocol.c index 481f21a96..ce2facc4b 100644 --- a/src/backend/distributed/master/master_node_protocol.c +++ b/src/backend/distributed/master/master_node_protocol.c @@ -78,6 +78,9 @@ PG_FUNCTION_INFO_V1(master_get_table_ddl_events); PG_FUNCTION_INFO_V1(master_get_new_shardid); PG_FUNCTION_INFO_V1(master_get_new_placementid); PG_FUNCTION_INFO_V1(master_get_active_worker_nodes); +PG_FUNCTION_INFO_V1(master_get_round_robin_candidate_nodes); +PG_FUNCTION_INFO_V1(master_stage_shard_row); +PG_FUNCTION_INFO_V1(master_stage_shard_placement_row); /* @@ -370,6 +373,45 @@ GetNextPlacementId(void) } +/* + * master_get_round_robin_candidate_nodes is a stub UDF to make pg_upgrade + * work flawlessly while upgrading servers from 6.1. This implementation + * will be removed after the UDF dropped on the sql side properly. + */ +Datum +master_get_round_robin_candidate_nodes(PG_FUNCTION_ARGS) +{ + ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("this function is deprecated and no longer is used"))); +} + + +/* + * master_stage_shard_row is a stub UDF to make pg_upgrade + * work flawlessly while upgrading servers from 6.1. This implementation + * will be removed after the UDF dropped on the sql side properly. + */ +Datum +master_stage_shard_row(PG_FUNCTION_ARGS) +{ + ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("this function is deprecated and no longer is used"))); +} + + +/* + * master_stage_shard_placement_row is a stub UDF to make pg_upgrade + * work flawlessly while upgrading servers from 6.1. This implementation + * will be removed after the UDF dropped on the sql side properly. + */ +Datum +master_stage_shard_placement_row(PG_FUNCTION_ARGS) +{ + ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("this function is deprecated and no longer is used"))); +} + + /* * master_get_active_worker_nodes returns a set of active worker host names and * port numbers in deterministic order. Currently we assume that all worker diff --git a/src/include/distributed/master_protocol.h b/src/include/distributed/master_protocol.h index 905c5bbbd..b4840fa96 100644 --- a/src/include/distributed/master_protocol.h +++ b/src/include/distributed/master_protocol.h @@ -139,6 +139,9 @@ extern Datum master_get_table_ddl_events(PG_FUNCTION_ARGS); extern Datum master_get_new_shardid(PG_FUNCTION_ARGS); extern Datum master_get_new_placementid(PG_FUNCTION_ARGS); extern Datum master_get_active_worker_nodes(PG_FUNCTION_ARGS); +extern Datum master_get_round_robin_candidate_nodes(PG_FUNCTION_ARGS); +extern Datum master_stage_shard_row(PG_FUNCTION_ARGS); +extern Datum master_stage_shard_placement_row(PG_FUNCTION_ARGS); /* Function declarations to help with data staging and deletion */ extern Datum master_create_empty_shard(PG_FUNCTION_ARGS);