From 50023fc1e35e9d2cd2fe8035e0ceab083b5b465c 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, 10 Jan 2025 18:06:10 +0800 Subject: [PATCH] modified: gausskernel/optimizer/commands/tablecmds.cpp modified: tablecmds.cpp modified: tablecmds.cpp modified: gausskernel/optimizer/commands/tablecmds.cpp modified: gausskernel/optimizer/commands/tablespace.cpp modified: gausskernel/optimizer/commands/tablecmds.cpp modified: tablespace.cpp modified: tablecmds.cpp --- src/gausskernel/optimizer/commands/tablecmds.cpp | 12 ++++++------ src/gausskernel/optimizer/commands/tablespace.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gausskernel/optimizer/commands/tablecmds.cpp b/src/gausskernel/optimizer/commands/tablecmds.cpp index 2cd3b35156..b8f8817299 100755 --- a/src/gausskernel/optimizer/commands/tablecmds.cpp +++ b/src/gausskernel/optimizer/commands/tablecmds.cpp @@ -1308,6 +1308,12 @@ static List* AddDefaultOptionsIfNeed(List* options, const char relkind, CreateSt errmsg("compresstype can not be used in segment table, " "column table, view, unlogged table or temp table."))); } + + if (tableCreateSupport.compressType && ENABLE_DMS) { + ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Compression is not supported while DMS and DSS enabled.\n"))); + } + CheckCompressOption(&tableCreateSupport); if (isUstore && !isCStore && !hasCompression && !tableCreateSupport.compressType) { @@ -2958,12 +2964,6 @@ ObjectAddress DefineRelation(CreateStmt* stmt, char relkind, Oid ownerId, Object !IsCStoreNamespace(namespaceId) && (pg_strcasecmp(storeChar, ORIENTATION_ROW) == 0) && (stmt->relation->relpersistence == RELPERSISTENCE_PERMANENT) && !u_sess->attr.attr_storage.enable_recyclebin) { bool isSegmentType = (storage_type == SEGMENT_PAGE); - if (!isSegmentType && (u_sess->attr.attr_storage.enable_segment || bucketinfo != NULL)) { - storage_type = SEGMENT_PAGE; - DefElem *storage_def = makeDefElem("segment", (Node *)makeString("on")); - stmt->options = lappend(stmt->options, storage_def); - reloptions = transformRelOptions((Datum)0, stmt->options, NULL, validnsps, true, false); - } } else if (storage_type == SEGMENT_PAGE) { if (u_sess->attr.attr_storage.enable_recyclebin) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmodule(MOD_SEGMENT_PAGE), diff --git a/src/gausskernel/optimizer/commands/tablespace.cpp b/src/gausskernel/optimizer/commands/tablespace.cpp index b5e992a86f..6ca2b5607d 100644 --- a/src/gausskernel/optimizer/commands/tablespace.cpp +++ b/src/gausskernel/optimizer/commands/tablespace.cpp @@ -2975,8 +2975,11 @@ void TableSpaceUsageManager::IsExceedMaxsize(Oid tableSpaceOid, uint64 requestSi return; } - /* just refresh currentSize if it is within limit */ - if (unlikely(currentSize) || (segment && requestSize != 0)) { + /* + * just refresh currentSize if it is within limit; + * The empty directory size in DSS file system is zero. + */ + if (ENABLE_DSS || unlikely(currentSize) || (segment && requestSize != 0)) { if (unlikely(TableSpaceUsageManager::IsFull(maxSize, currentSize, requestSize)) && !u_sess->attr.attr_common.IsInplaceUpgrade) { /* -- Gitee