diff --git a/src/common/backend/catalog/builtin_funcs.ini b/src/common/backend/catalog/builtin_funcs.ini index 33ae61507..d489c8b2e 100755 --- a/src/common/backend/catalog/builtin_funcs.ini +++ b/src/common/backend/catalog/builtin_funcs.ini @@ -8641,7 +8641,7 @@ ), AddFuncGroup( "pg_stat_get_wal_senders", 1, - AddBuiltinFunc(_0(3099), _1("pg_stat_get_wal_senders"), _2(0), _3(false), _4(true), _5(pg_stat_get_wal_senders), _6(2249), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(10), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('s'), _19(0), _20(0), _21(22, 20, 23, 25, 25, 25, 25, 1184, 1184, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 25, 23), _22(22, 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o'), _23(22, "pid", "sender_pid", "local_role", "peer_role", "peer_state", "state", "catchup_start", "catchup_end", "sender_sent_location", "sender_write_location", "sender_flush_location", "sender_replay_location", "receiver_received_location", "receiver_write_location", "receiver_flush_location", "receiver_replay_location", "sync_percent", "sync_state", "sync_priority", "sync_most_available", "channel", "sync_group"), _24(NULL), _25("pg_stat_get_wal_senders"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33("statistics: information about currently active replication"), _34('f'), _35(NULL), _36(0), _37(false), _38(NULL), _39(NULL), _40(0)) + AddBuiltinFunc(_0(3099), _1("pg_stat_get_wal_senders"), _2(0), _3(false), _4(true), _5(pg_stat_get_wal_senders), _6(2249), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(10), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('s'), _19(0), _20(0), _21(21, 20, 23, 25, 25, 25, 25, 1184, 1184, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 25), _22(21, 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o'), _23(21, "pid", "sender_pid", "local_role", "peer_role", "peer_state", "state", "catchup_start", "catchup_end", "sender_sent_location", "sender_write_location", "sender_flush_location", "sender_replay_location", "receiver_received_location", "receiver_write_location", "receiver_flush_location", "receiver_replay_location", "sync_percent", "sync_state", "sync_priority", "sync_most_available", "channel"), _24(NULL), _25("pg_stat_get_wal_senders"), _26(NULL), _27(NULL), _28(NULL), _29(0), _30(false), _31(NULL), _32(false), _33("statistics: information about currently active replication"), _34('f'), _35(NULL), _36(0), _37(false), _38(NULL), _39(NULL), _40(0)) ), AddFuncGroup( "pg_stat_get_wlm_ec_operator_info", 1, diff --git a/src/common/backend/utils/init/globals.cpp b/src/common/backend/utils/init/globals.cpp index 8b4b9cf8c..a8329d9ea 100644 --- a/src/common/backend/utils/init/globals.cpp +++ b/src/common/backend/utils/init/globals.cpp @@ -59,7 +59,7 @@ bool open_join_children = true; bool will_shutdown = false; /* hard-wired binary version number */ -const uint32 GRAND_VERSION_NUM = 92606; +const uint32 GRAND_VERSION_NUM = 92605; const uint32 PREDPUSH_SAME_LEVEL_VERSION_NUM = 92522; const uint32 UPSERT_WHERE_VERSION_NUM = 92514; diff --git a/src/gausskernel/storage/replication/walsender.cpp b/src/gausskernel/storage/replication/walsender.cpp index 6e62e101b..bb659178a 100755 --- a/src/gausskernel/storage/replication/walsender.cpp +++ b/src/gausskernel/storage/replication/walsender.cpp @@ -5814,7 +5814,7 @@ Datum gs_paxos_stat_replication(PG_FUNCTION_ARGS) */ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) { -#define PG_STAT_GET_WAL_SENDERS_COLS 22 +#define PG_STAT_GET_WAL_SENDERS_COLS 21 TupleDesc tupdesc; int *sync_priority = NULL; @@ -5945,9 +5945,6 @@ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) rc = memset_s(&nulls[j], PG_STAT_GET_WAL_SENDERS_COLS - j, true, PG_STAT_GET_WAL_SENDERS_COLS - j); securec_check(rc, "", ""); } else { - Datum group_values; - bool group_isnull = false; - /* local_role */ values[j++] = CStringGetTextDatum(wal_get_role_string(local_role)); @@ -6054,11 +6051,9 @@ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) /* sync_state and sync_prority */ if (!SyncRepRequested()) { values[j++] = CStringGetTextDatum("Async"); - group_isnull = true; values[j++] = Int32GetDatum(0); } else { values[j++] = CStringGetTextDatum("Sync"); - group_isnull = true; values[j++] = Int32GetDatum(sync_priority[i]); } } else { @@ -6080,15 +6075,12 @@ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) */ if (priority == 0) { values[j++] = CStringGetTextDatum("Async"); - group_isnull = true; } else if (list_member_int((List*)list_nth(sync_standbys, group), i)) { values[j++] = GetWalsndSyncRepConfig(walsnd)->syncrep_method == SYNC_REP_PRIORITY ? CStringGetTextDatum("Sync") : CStringGetTextDatum("Quorum"); - group_values = Int32GetDatum(group); } else { values[j++] = CStringGetTextDatum("Potential"); - group_values = Int32GetDatum(group); } values[j++] = Int32GetDatum(priority); } @@ -6107,12 +6099,6 @@ Datum pg_stat_get_wal_senders(PG_FUNCTION_ARGS) securec_check_ss(ret, "\0", "\0"); } values[j++] = CStringGetTextDatum(location); - - if (!group_isnull) { - values[j++] = group_values; - } else { - nulls[j++] = true; - } } tuplestore_putvalues(tupstore, tupdesc, values, nulls); diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_606.sql b/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_606.sql deleted file mode 100644 index ff5477f71..000000000 --- a/src/include/catalog/upgrade_sql/rollback_catalog_maindb/rollback_catalog_maindb_92_606.sql +++ /dev/null @@ -1,37 +0,0 @@ --- for any x group -DO $$ -DECLARE -ans boolean; -BEGIN - select case when working_version_num()=92301 then true else false end as ans into ans; - if ans = false then - DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; - SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; - CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text - ) RETURNS SETOF record - STABLE NOT FENCED NOT SHIPPABLE ROWS 10 - LANGUAGE internal AS 'pg_stat_get_wal_senders'; - end if; -END$$; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; diff --git a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_606.sql b/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_606.sql deleted file mode 100644 index ff5477f71..000000000 --- a/src/include/catalog/upgrade_sql/rollback_catalog_otherdb/rollback_catalog_otherdb_92_606.sql +++ /dev/null @@ -1,37 +0,0 @@ --- for any x group -DO $$ -DECLARE -ans boolean; -BEGIN - select case when working_version_num()=92301 then true else false end as ans into ans; - if ans = false then - DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; - SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; - CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text - ) RETURNS SETOF record - STABLE NOT FENCED NOT SHIPPABLE ROWS 10 - LANGUAGE internal AS 'pg_stat_get_wal_senders'; - end if; -END$$; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_606.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_606.sql deleted file mode 100644 index 1d3d5ead7..000000000 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_606.sql +++ /dev/null @@ -1,38 +0,0 @@ --- for any x group -DO $$ -DECLARE -ans boolean; -BEGIN - select case when working_version_num()=92301 then true else false end as ans into ans; - if ans = false then - DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; - SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; - CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text, - OUT sync_group integer - ) RETURNS SETOF record - STABLE NOT FENCED NOT SHIPPABLE ROWS 10 - LANGUAGE internal AS 'pg_stat_get_wal_senders'; - end if; -END$$; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; \ No newline at end of file diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_606.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_606.sql deleted file mode 100644 index 1d3d5ead7..000000000 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_606.sql +++ /dev/null @@ -1,38 +0,0 @@ --- for any x group -DO $$ -DECLARE -ans boolean; -BEGIN - select case when working_version_num()=92301 then true else false end as ans into ans; - if ans = false then - DROP FUNCTION IF EXISTS pg_catalog.pg_stat_get_wal_senders() CASCADE; - SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 3099; - CREATE FUNCTION pg_catalog.pg_stat_get_wal_senders( - OUT pid bigint, - OUT sender_pid integer, - OUT local_role text, - OUT peer_role text, - OUT peer_state text, - OUT state text, - OUT catchup_start timestamp with time zone, - OUT catchup_end timestamp with time zone, - OUT sender_sent_location text, - OUT sender_write_location text, - OUT sender_flush_location text, - OUT sender_replay_location text, - OUT receiver_received_location text, - OUT receiver_write_location text, - OUT receiver_flush_location text, - OUT receiver_replay_location text, - OUT sync_percent text, - OUT sync_state text, - OUT sync_priority integer, - OUT sync_most_available text, - OUT channel text, - OUT sync_group integer - ) RETURNS SETOF record - STABLE NOT FENCED NOT SHIPPABLE ROWS 10 - LANGUAGE internal AS 'pg_stat_get_wal_senders'; - end if; -END$$; -SET LOCAL inplace_upgrade_next_system_object_oids = IUO_PROC, 0; \ No newline at end of file