From 3ff7aa248fd50a1e9894e515d3a311dc5efcb877 Mon Sep 17 00:00:00 2001 From: sundechao Date: Fri, 7 Jun 2024 18:08:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=A2=E5=BC=95=E5=8A=A0=E5=9B=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复STAT_UNDO_LOG_SIZE长度不足导致check报错 --- src/common/backend/utils/adt/pgundostatfuncs.cpp | 2 +- src/gausskernel/process/postmaster/snapcapturer.cpp | 2 +- src/gausskernel/storage/tcap/tcap_version.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/backend/utils/adt/pgundostatfuncs.cpp b/src/common/backend/utils/adt/pgundostatfuncs.cpp index 672c70196..67b5686c1 100644 --- a/src/common/backend/utils/adt/pgundostatfuncs.cpp +++ b/src/common/backend/utils/adt/pgundostatfuncs.cpp @@ -77,7 +77,7 @@ const int UNDO_TOPUSED = 0; const int UNDO_SECONDUSED = 1; const int UNDO_THIRDUSED = 2; const int PG_STAT_USP_PERSIST_META_COLS = 9; -const int STAT_UNDO_LOG_SIZE = 17; +const int STAT_UNDO_LOG_SIZE = 32; const int PG_STAT_UBTREE_IDX_VERFIY_COLS = 4; const int PG_STAT_UBTREE_RECYCLE_QUEUE_COLS = 6; const int PG_STAT_TRANSLOT_META_COLS = 7; diff --git a/src/gausskernel/process/postmaster/snapcapturer.cpp b/src/gausskernel/process/postmaster/snapcapturer.cpp index 2dc218d9c..41f1a6b10 100644 --- a/src/gausskernel/process/postmaster/snapcapturer.cpp +++ b/src/gausskernel/process/postmaster/snapcapturer.cpp @@ -902,7 +902,7 @@ NON_EXEC_STATIC void TxnSnapCapturerMain() TxnSnapCapProcInterrupts(rc); /* Do the hard work. */ - if (TcapFeatureAvail()) { + if (TcapFeatureAvail() && ENABLE_TCAP_VERSION) { TxnSnapCapImpl(); } diff --git a/src/gausskernel/storage/tcap/tcap_version.cpp b/src/gausskernel/storage/tcap/tcap_version.cpp index 0d736816e..9606f10c7 100644 --- a/src/gausskernel/storage/tcap/tcap_version.cpp +++ b/src/gausskernel/storage/tcap/tcap_version.cpp @@ -124,6 +124,10 @@ static bool TvFeatureSupport(Oid relid, char **errstr, bool isTimecapsuleTable) Relation rel = RelationIdGetRelation(relid); Form_pg_class classForm; + if (!ENABLE_TCAP_VERSION) { + ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("timecapsule feature is not enabled."))); + } if (!RelationIsValid(rel)) { ereport(ERROR, (errcode(ERRCODE_RELATION_OPEN_ERROR), errmsg("could not open relation with OID %u", relid)));