From d8b64368f04a79140edf4065ef02670053a6f103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E6=89=BF=E5=BF=97?= <842536125@qq.com> Date: Fri, 27 Dec 2024 15:38:38 +0800 Subject: [PATCH 1/3] modified: bin/initdb/initdb.cpp modified: common/backend/catalog/heap.cpp modified: gausskernel/bootstrap/bootstrap.cpp modified: gausskernel/optimizer/commands/indexcmds.cpp modified: gausskernel/optimizer/commands/tablecmds.cpp --- src/bin/initdb/initdb.cpp | 4 ---- src/common/backend/catalog/heap.cpp | 14 -------------- src/gausskernel/bootstrap/bootstrap.cpp | 5 +---- src/gausskernel/optimizer/commands/indexcmds.cpp | 3 +++ src/gausskernel/optimizer/commands/tablecmds.cpp | 11 ++--------- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/src/bin/initdb/initdb.cpp b/src/bin/initdb/initdb.cpp index a86381e11b..3369cade2c 100644 --- a/src/bin/initdb/initdb.cpp +++ b/src/bin/initdb/initdb.cpp @@ -1599,10 +1599,6 @@ static void setup_config(void) securec_check_c(nRet, "\0", "\0"); conflines = replace_token(conflines, "#ss_enable_dss = off", repltok); - nRet = strcpy_s(repltok, sizeof(repltok), "enable_segment = on"); - securec_check_c(nRet, "\0", "\0"); - conflines = replace_token(conflines, "#enable_segment = off", repltok); - nRet = strcpy_s(repltok, sizeof(repltok), "enable_double_write = off"); securec_check_c(nRet, "\0", "\0"); conflines = replace_token(conflines, "enable_double_write = on", repltok); diff --git a/src/common/backend/catalog/heap.cpp b/src/common/backend/catalog/heap.cpp index 3acb2f3048..6f3fce2699 100644 --- a/src/common/backend/catalog/heap.cpp +++ b/src/common/backend/catalog/heap.cpp @@ -550,13 +550,6 @@ Relation heap_create(const char* relname, Oid relnamespace, Oid reltablespace, O Relation rel; bool isbucket = false; - if ((IsInitdb && EnableInitDBSegment) || (u_sess->attr.attr_common.IsInplaceUpgrade && ENABLE_DMS)) { - /* store tables in segment storage as all possible while initdb */ - if (relpersistence == RELPERSISTENCE_PERMANENT) { - storage_type = SEGMENT_PAGE; - } - } - /* The caller must have provided an OID for the relation. */ Assert(OidIsValid(relid)); @@ -2717,13 +2710,6 @@ Oid heap_create_with_catalog(const char *relname, Oid relnamespace, Oid reltable ereport(WARNING, (errmsg("Store unlogged table in segment when enable system table segment"))); } - - /* store tables in segment storage as all possible while initdb */ - if (relpersistence == RELPERSISTENCE_PERMANENT && (relkind == RELKIND_RELATION || - relkind == RELKIND_INDEX || relkind == RELKIND_GLOBAL_INDEX)) { - storage_type = SEGMENT_PAGE; - reloptions = AddSegmentOption(reloptions); - } } pg_class_desc = heap_open(RelationRelationId, RowExclusiveLock); diff --git a/src/gausskernel/bootstrap/bootstrap.cpp b/src/gausskernel/bootstrap/bootstrap.cpp index a1719d5d9b..02a3b690da 100755 --- a/src/gausskernel/bootstrap/bootstrap.cpp +++ b/src/gausskernel/bootstrap/bootstrap.cpp @@ -275,7 +275,7 @@ void BootStrapProcessMain(int argc, char* argv[]) SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV); break; case 'G': - EnableInitDBSegment = true; + EnableInitDBSegment = false; break; case 'g': SetConfigOption("xlog_file_path", optCtxt.optarg, PGC_POSTMASTER, PGC_S_ARGV); @@ -734,9 +734,6 @@ void InsertOneTuple(Oid objectid) ereport(FATAL, (errmsg("Built-in functions should not be added into pg_proc"))); } - if (IsBootingPgClass(t_thrd.bootstrap_cxt.boot_reldesc) && EnableInitDBSegment) { - ChangePgClassBucketValueForSegment(); - } tupDesc = CreateTupleDesc(t_thrd.bootstrap_cxt.numattr, RelationGetForm(t_thrd.bootstrap_cxt.boot_reldesc)->relhasoids, t_thrd.bootstrap_cxt.attrtypes, diff --git a/src/gausskernel/optimizer/commands/indexcmds.cpp b/src/gausskernel/optimizer/commands/indexcmds.cpp index 285d5bd35a..f81f2dc5a3 100644 --- a/src/gausskernel/optimizer/commands/indexcmds.cpp +++ b/src/gausskernel/optimizer/commands/indexcmds.cpp @@ -802,6 +802,9 @@ ObjectAddress DefineIndex(Oid relationId, IndexStmt* stmt, Oid indexRelationId, */ lockmode = concurrent ? ShareUpdateExclusiveLock : ShareLock; rel = heap_open(relationId, lockmode); + if (rel->storage_type == SEGMENT_PAGE) { + ereport(WARNING, (errmsg("open a segment table. %s", rel->rd_rel->relname.data))); + } bool segment = get_rel_segment(rel); TableCreateSupport indexCreateSupport{(int)COMPRESS_TYPE_NONE, false, false, false, false, false, true, false}; diff --git a/src/gausskernel/optimizer/commands/tablecmds.cpp b/src/gausskernel/optimizer/commands/tablecmds.cpp index 0eae0f4fd8..a6d7baad0e 100755 --- a/src/gausskernel/optimizer/commands/tablecmds.cpp +++ b/src/gausskernel/optimizer/commands/tablecmds.cpp @@ -3029,19 +3029,12 @@ ObjectAddress DefineRelation(CreateStmt* stmt, char relkind, Oid ownerId, Object } if (ENABLE_DMS && !u_sess->attr.attr_common.IsInplaceUpgrade) { - if ((relkind == RELKIND_RELATION && storage_type != SEGMENT_PAGE) || - relkind == RELKIND_MATVIEW || - pg_strcasecmp(storeChar, ORIENTATION_ROW) != 0 || - relkind == RELKIND_FOREIGN_TABLE || - stmt->relation->relpersistence == RELPERSISTENCE_UNLOGGED || - stmt->relation->relpersistence == RELPERSISTENCE_TEMP || - stmt->relation->relpersistence == RELPERSISTENCE_GLOBAL_TEMP || + if (pg_strcasecmp(storeChar, ORIENTATION_ROW) != 0 || pg_strcasecmp(COMPRESSION_NO, StdRdOptionsGetStringData(std_opt, compression, COMPRESSION_NO)) != 0 || IsCompressedByCmprsInPgclass((RelCompressType)stmt->row_compress)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("Only support segment storage type and ASTORE while DMS and DSS enabled.\n" - "Foreign table, matview, temp table or unlogged table is not supported.\nCompression is not " - "supported."))); + "Compression is not supported."))); } } -- Gitee From db76ca3f0884d4841b9b05d743b80c7d8153b285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E6=89=BF=E5=BF=97?= <842536125@qq.com> Date: Fri, 27 Dec 2024 16:21:28 +0800 Subject: [PATCH 2/3] modified: gausskernel/ddes/ddes_commit_id --- src/gausskernel/ddes/ddes_commit_id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gausskernel/ddes/ddes_commit_id b/src/gausskernel/ddes/ddes_commit_id index c452049f99..dc0a0834d1 100644 --- a/src/gausskernel/ddes/ddes_commit_id +++ b/src/gausskernel/ddes/ddes_commit_id @@ -1,3 +1,3 @@ dms_commit_id=7a838edc5ae2bdf64aa685bc46cf982df67148d7 dss_commit_id=cc43135b5634f2fd1951ff7f2a581917bf0357cb -cbb_commit_id=9fbaa64d112158d1da22d7e34414ffcb62486f0b \ No newline at end of file +cbb_commit_id=ad8c2a2469e2c53abfb8f9378a6ffec29a63f7a6 \ No newline at end of file -- Gitee From c2132b732b2b95cc3c1343d9a19dd9a1816025fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E6=89=BF=E5=BF=97?= <842536125@qq.com> Date: Sat, 28 Dec 2024 16:18:30 +0800 Subject: [PATCH 3/3] modified: ../common/backend/parser/gram.y modified: po/zh_CN.po --- src/common/backend/parser/gram.y | 17 ----------------- src/gausskernel/po/zh_CN.po | 7 ------- 2 files changed, 24 deletions(-) diff --git a/src/common/backend/parser/gram.y b/src/common/backend/parser/gram.y index 4f396b45ec..57c7ab550d 100644 --- a/src/common/backend/parser/gram.y +++ b/src/common/backend/parser/gram.y @@ -10108,11 +10108,6 @@ CreateMatViewStmt: errmsg("It's not supported to specify distribute key on incremental materialized views"))); } #endif - if (ENABLE_DMS) { - ereport(errstate, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("matview is not supported while DMS and DSS enabled."))); - } - $$ = (Node *) ctas; } | CREATE MATERIALIZED VIEW create_mv_target build_deferred AS SelectStmt @@ -10126,12 +10121,6 @@ CreateMatViewStmt: $4->rel->relpersistence = RELPERSISTENCE_PERMANENT; $4->skipData = $5; $4->ivm = false; - - if (ENABLE_DMS) { - ereport(errstate, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("matview is not supported while DMS and DSS enabled."))); - } - $$ = (Node *) ctas; } | CREATE MATERIALIZED VIEW create_mv_target AS SelectStmt opt_with_data @@ -10145,12 +10134,6 @@ CreateMatViewStmt: $4->rel->relpersistence = RELPERSISTENCE_PERMANENT; $4->skipData = !($7); $4->ivm = false; - - if (ENABLE_DMS) { - ereport(errstate, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("matview is not supported while DMS and DSS enabled."))); - } - $$ = (Node *) ctas; } ; diff --git a/src/gausskernel/po/zh_CN.po b/src/gausskernel/po/zh_CN.po index 0a06f104d8..d696ebe91d 100644 --- a/src/gausskernel/po/zh_CN.po +++ b/src/gausskernel/po/zh_CN.po @@ -48736,13 +48736,6 @@ msgstr "暂不支持增量物化视图的选项" msgid "It's not supported to specify distribute key on incremental materialized views" msgstr "不支持在增量物化视图上指定分布键" -# input.c:213 -# -#: gram.y:9776 -#, c-format -msgid "matview is not supported while DMS and DSS enabled." -msgstr "当DMS和DSS启用时, 不支持matview。" - #: gram.y:9863 gram.y:9890 #, c-format msgid "large sequence is not supported." -- Gitee