From 172fcce4aefde6b8dbf58460b752174658a53ce5 Mon Sep 17 00:00:00 2001 From: laishenghao Date: Thu, 23 Nov 2023 20:49:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20gs=5Fstat=5Fwalrecvwriter?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/catalog/builtin_funcs.ini | 2 +- src/common/backend/utils/adt/walreceiver_statfuncs.cpp | 4 ++-- .../upgrade-post_catalog_maindb_92_917.sql | 2 +- .../upgrade-post_catalog_otherdb_92_917.sql | 2 +- src/test/regress/output/component_view_enhancements.source | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/backend/catalog/builtin_funcs.ini b/src/common/backend/catalog/builtin_funcs.ini index cfcadfa03..eefeefc1b 100644 --- a/src/common/backend/catalog/builtin_funcs.ini +++ b/src/common/backend/catalog/builtin_funcs.ini @@ -4035,7 +4035,7 @@ ), AddFuncGroup( "gs_stat_walrecvwriter", 1, - AddBuiltinFunc(_0(2868), _1("gs_stat_walrecvwriter"), _2(1), _3(false), _4(true), _5(gs_stat_walrecvwriter), _6(2249), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(1), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('s'), _19(1), _20(1, 23), _21(16, 23, 16, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 1184, 1184), _22(16, 'i', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o'), _23(16, "operation", "is_enable_stat", "total_write_bytes", "write_times", "total_write_time", "avg_write_time", "avg_write_bytes", "total_sync_bytes", "sync_times", "total_sync_time", "avg_sync_time", "avg_sync_bytes", "current_xlog_segno", "newest_xlog_segno", "last_reset_time", "cur_time"), _24("({CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :ismaxvalue false :location -1 :constvalue 4 [ 2 0 0 0 0 0 0 0 ] :cursor_data :row_count 0 :cur_dno -1 :is_open false :found false :not_found false :null_open false :null_fetch false})"), _25("gs_stat_walrecvwriter"), _26(NULL), _27(NULL), _28(NULL), _29(1, 0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f'), _35(NULL), _36(0), _37(false), _38(NULL), _39(NULL), _40(0)) + AddBuiltinFunc(_0(2868), _1("gs_stat_walrecvwriter"), _2(1), _3(false), _4(true), _5(gs_stat_walrecvwriter), _6(2249), _7(PG_CATALOG_NAMESPACE), _8(BOOTSTRAP_SUPERUSERID), _9(INTERNALlanguageId), _10(1), _11(1), _12(0), _13(0), _14(false), _15(false), _16(false), _17(false), _18('s'), _19(1), _20(1, 23), _21(16, 23, 16, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 1184, 1184), _22(16, 'i', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o'), _23(16, "operation", "is_enable_stat", "total_write_bytes", "write_times", "total_write_time", "avg_write_time", "avg_write_bytes", "total_sync_bytes", "sync_times", "total_sync_time", "avg_sync_time", "avg_sync_bytes", "current_xlog_segno", "inited_xlog_segno", "last_reset_time", "cur_time"), _24("({CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :ismaxvalue false :location -1 :constvalue 4 [ 2 0 0 0 0 0 0 0 ] :cursor_data :row_count 0 :cur_dno -1 :is_open false :found false :not_found false :null_open false :null_fetch false})"), _25("gs_stat_walrecvwriter"), _26(NULL), _27(NULL), _28(NULL), _29(1, 0), _30(false), _31(NULL), _32(false), _33(NULL), _34('f'), _35(NULL), _36(0), _37(false), _38(NULL), _39(NULL), _40(0)) ), AddFuncGroup( "gs_xlogdump_lsn", 1, diff --git a/src/common/backend/utils/adt/walreceiver_statfuncs.cpp b/src/common/backend/utils/adt/walreceiver_statfuncs.cpp index a07999437..587812e0d 100644 --- a/src/common/backend/utils/adt/walreceiver_statfuncs.cpp +++ b/src/common/backend/utils/adt/walreceiver_statfuncs.cpp @@ -83,7 +83,7 @@ Datum gs_stat_walreceiver(PG_FUNCTION_ARGS) * avg_sync_time uint64 * avg_sync_bytes uint64 * current_xlog_segno uint64 -* newest_xlog_segno uint64 +* inited_xlog_segno uint64 * last_reset_time timestamptz * cur_time timestamptz */ @@ -318,7 +318,7 @@ static void BuildRecvWriterStatsTupleValues(TupleDesc tupleDesc, Tuplestorestate /* current_xlog_segno */ values[colIdx++] = UInt64GetDatum(currentXlogSegno); - /* newest_xlog_segno */ + /* inited_xlog_segno */ values[colIdx++] = UInt64GetDatum(GetNewestXLOGSegNo(t_thrd.proc_cxt.DataDir)); /* last_reset_time */ isnulls[colIdx] = (lastResetTime == 0); diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_917.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_917.sql index 16d363a6c..cca5c92e9 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_917.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_maindb/upgrade-post_catalog_maindb_92_917.sql @@ -50,7 +50,7 @@ CREATE FUNCTION pg_catalog.gs_stat_walrecvwriter( out avg_sync_time xid, out avg_sync_bytes xid, out current_xlog_segno xid, - out newest_xlog_segno xid, + out inited_xlog_segno xid, out last_reset_time timestamptz, out cur_time timestamptz ) diff --git a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_917.sql b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_917.sql index 16d363a6c..cca5c92e9 100644 --- a/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_917.sql +++ b/src/include/catalog/upgrade_sql/upgrade_catalog_otherdb/upgrade-post_catalog_otherdb_92_917.sql @@ -50,7 +50,7 @@ CREATE FUNCTION pg_catalog.gs_stat_walrecvwriter( out avg_sync_time xid, out avg_sync_bytes xid, out current_xlog_segno xid, - out newest_xlog_segno xid, + out inited_xlog_segno xid, out last_reset_time timestamptz, out cur_time timestamptz ) diff --git a/src/test/regress/output/component_view_enhancements.source b/src/test/regress/output/component_view_enhancements.source index d5517d26b..71fa5ca00 100644 --- a/src/test/regress/output/component_view_enhancements.source +++ b/src/test/regress/output/component_view_enhancements.source @@ -106,19 +106,19 @@ ERROR: illegal value "4" for parameter "operation". HINT: -1: disable, 0: reset, 1: enable, 2: get -- wal recvwriter select * from gs_stat_walrecvwriter(); ---? is_enable_stat | total_write_bytes | write_times | total_write_time | avg_write_time | avg_write_bytes | total_sync_bytes | sync_times | total_sync_time | avg_sync_time | avg_sync_bytes | current_xlog_segno | newest_xlog_segno | last_reset_time |.* +--? is_enable_stat | total_write_bytes | write_times | total_write_time | avg_write_time | avg_write_bytes | total_sync_bytes | sync_times | total_sync_time | avg_sync_time | avg_sync_bytes | current_xlog_segno | inited_xlog_segno | last_reset_time |.* --?.* --? f | 0 | 0 | 0 | | | 0 | 0 | 0 | | | 0 | 2 | |.* (1 row) select * from gs_stat_walrecvwriter(1); ---? is_enable_stat | total_write_bytes | write_times | total_write_time | avg_write_time | avg_write_bytes | total_sync_bytes | sync_times | total_sync_time | avg_sync_time | avg_sync_bytes | current_xlog_segno | newest_xlog_segno | last_reset_time |.* +--? is_enable_stat | total_write_bytes | write_times | total_write_time | avg_write_time | avg_write_bytes | total_sync_bytes | sync_times | total_sync_time | avg_sync_time | avg_sync_bytes | current_xlog_segno | inited_xlog_segno | last_reset_time |.* --?.* --? t | 0 | 0 | 0 | | | 0 | 0 | 0 | | | 0 | 2 | |.* (1 row) select * from gs_stat_walrecvwriter(2); ---? is_enable_stat | total_write_bytes | write_times | total_write_time | avg_write_time | avg_write_bytes | total_sync_bytes | sync_times | total_sync_time | avg_sync_time | avg_sync_bytes | current_xlog_segno | newest_xlog_segno | last_reset_time |.* +--? is_enable_stat | total_write_bytes | write_times | total_write_time | avg_write_time | avg_write_bytes | total_sync_bytes | sync_times | total_sync_time | avg_sync_time | avg_sync_bytes | current_xlog_segno | inited_xlog_segno | last_reset_time |.* --?.* --? t | 0 | 0 | 0 | | | 0 | 0 | 0 | | | 0 | 2 | |.* (1 row)