diff --git a/src/bin/initdb/initdb.cpp b/src/bin/initdb/initdb.cpp index e1010c075bc45f9c2341d4b1e0bfca1e0a14627b..17fe271d2c502e4ec14e4c795b0f7bb65e5e42ba 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 3acb2f30489fe254086304bcd4dea4eecfbc904a..6f3fce26999a513ef20cdb3626ab206f23172da1 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 a1719d5d9b86187ab7be7b68bb9ac3eeaa67932f..de044b23ada6c5ac2d2b211caaea7fec178fea10 100755 --- a/src/gausskernel/bootstrap/bootstrap.cpp +++ b/src/gausskernel/bootstrap/bootstrap.cpp @@ -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 285d5bd35a57980d4416421c2e91339a95a97685..c1f0ff9ea66d989b2331acc0e5c2e205243aad50 100644 --- a/src/gausskernel/optimizer/commands/indexcmds.cpp +++ b/src/gausskernel/optimizer/commands/indexcmds.cpp @@ -802,7 +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}; ListCell *cell = NULL; diff --git a/src/gausskernel/optimizer/commands/tablecmds.cpp b/src/gausskernel/optimizer/commands/tablecmds.cpp index ca96430061b401202c15975f3d20ab18cc534329..81d27d307a0e005cdc839e0bcf13941fec995e21 100755 --- a/src/gausskernel/optimizer/commands/tablecmds.cpp +++ b/src/gausskernel/optimizer/commands/tablecmds.cpp @@ -3029,23 +3029,18 @@ 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."))); + 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."))); } } - if (!IsInitdb && u_sess->attr.attr_storage.enable_segment && storage_type == SEGMENT_PAGE && + if (!IsInitdb && u_sess->attr.attr_storage.enable_segment && !CheckSegmentStorageOption(stmt->options)) { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("Only support segment storage type while parameter enable_segment is ON.")));