未验证 提交 f85c426b 编写于 作者: J Jialun 提交者: GitHub

Update cpuset error message to include more helpful hints (#5124)

上级 135e24ba
...@@ -239,8 +239,8 @@ CreateResourceGroup(CreateResourceGroupStmt *stmt) ...@@ -239,8 +239,8 @@ CreateResourceGroup(CreateResourceGroupStmt *stmt)
} }
else if (!CpusetIsEmpty(caps.cpuset)) else if (!CpusetIsEmpty(caps.cpuset))
{ {
if (gp_resource_group_enable_cgroup_cpuset) EnsureCpusetIsAvailable(ERROR);
{
ResGroupOps_SetCpuSet(groupid, caps.cpuset); ResGroupOps_SetCpuSet(groupid, caps.cpuset);
/* reset default group, subtract new group cpu cores */ /* reset default group, subtract new group cpu cores */
char defaultGroupCpuset[MaxCpuSetLength]; char defaultGroupCpuset[MaxCpuSetLength];
...@@ -250,14 +250,6 @@ CreateResourceGroup(CreateResourceGroupStmt *stmt) ...@@ -250,14 +250,6 @@ CreateResourceGroup(CreateResourceGroupStmt *stmt)
CpusetDifference(defaultGroupCpuset, caps.cpuset, MaxCpuSetLength); CpusetDifference(defaultGroupCpuset, caps.cpuset, MaxCpuSetLength);
ResGroupOps_SetCpuSet(DEFAULT_CPUSET_GROUP_ID, defaultGroupCpuset); ResGroupOps_SetCpuSet(DEFAULT_CPUSET_GROUP_ID, defaultGroupCpuset);
} }
else
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cpuset is disabled for cpuset/gpdb "
"does not exist")));
}
}
SIMPLE_FAULT_INJECTOR(CreateResourceGroupFail); SIMPLE_FAULT_INJECTOR(CreateResourceGroupFail);
} }
else if (Gp_role == GP_ROLE_DISPATCH) else if (Gp_role == GP_ROLE_DISPATCH)
...@@ -273,7 +265,6 @@ void ...@@ -273,7 +265,6 @@ void
DropResourceGroup(DropResourceGroupStmt *stmt) DropResourceGroup(DropResourceGroupStmt *stmt)
{ {
Relation pg_resgroup_rel; Relation pg_resgroup_rel;
Relation pg_resgroupcapability_rel;
HeapTuple tuple; HeapTuple tuple;
ScanKeyData scankey; ScanKeyData scankey;
SysScanDesc sscan; SysScanDesc sscan;
...@@ -402,19 +393,8 @@ AlterResourceGroup(AlterResourceGroupStmt *stmt) ...@@ -402,19 +393,8 @@ AlterResourceGroup(AlterResourceGroupStmt *stmt)
} }
else if (limitType == RESGROUP_LIMIT_TYPE_CPUSET) else if (limitType == RESGROUP_LIMIT_TYPE_CPUSET)
{ {
if (!IsResGroupActivated()) EnsureCpusetIsAvailable(ERROR);
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("must specify cpuset when resource group is activated")));
}
else if (!gp_resource_group_enable_cgroup_cpuset)
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cpuset is disabled for cpuset/gpdb "
"does not exist")));
}
cpuset = defGetString(defel); cpuset = defGetString(defel);
checkCpusetSyntax(cpuset); checkCpusetSyntax(cpuset);
} }
...@@ -777,7 +757,7 @@ GetResGroupNameForId(Oid oid) ...@@ -777,7 +757,7 @@ GetResGroupNameForId(Oid oid)
name = pstrdup(NameStr(*resGroupName)); name = pstrdup(NameStr(*resGroupName));
} }
else else
return "unknow"; return "unknown";
ReleaseSysCache(tuple); ReleaseSysCache(tuple);
...@@ -1072,11 +1052,8 @@ parseStmtOptions(CreateResourceGroupStmt *stmt, ResGroupCaps *caps) ...@@ -1072,11 +1052,8 @@ parseStmtOptions(CreateResourceGroupStmt *stmt, ResGroupCaps *caps)
} }
} }
if ((mask & (1 << RESGROUP_LIMIT_TYPE_CPUSET)) && if ((mask & (1 << RESGROUP_LIMIT_TYPE_CPUSET)))
!IsResGroupActivated()) EnsureCpusetIsAvailable(ERROR);
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("must specify cpuset when resource group is activated")));
if (!(mask & (1 << RESGROUP_LIMIT_TYPE_MEMORY))) if (!(mask & (1 << RESGROUP_LIMIT_TYPE_MEMORY)))
ereport(ERROR, ereport(ERROR,
...@@ -1301,15 +1278,13 @@ validateCapabilities(Relation rel, ...@@ -1301,15 +1278,13 @@ validateCapabilities(Relation rel,
int totalCpu = caps->cpuRateLimit; int totalCpu = caps->cpuRateLimit;
int totalMem = caps->memLimit; int totalMem = caps->memLimit;
char cpusetAll[MaxCpuSetLength] = {0}; char cpusetAll[MaxCpuSetLength] = {0};
Bitmapset *bmsUnused = NULL; char cpusetMissing[MaxCpuSetLength] = {0};
Bitmapset *bmsCurrent = NULL; Bitmapset *bmsCurrent = NULL;
Bitmapset *bmsCommon = NULL;
if (!gp_resource_group_enable_cgroup_cpuset && if (!CpusetIsEmpty(caps->cpuset))
!CpusetIsEmpty(caps->cpuset))
{ {
ereport(ERROR, EnsureCpusetIsAvailable(ERROR);
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cpuset is disabled for cpuset/gpdb does not exist")));
} }
/* /*
...@@ -1318,22 +1293,31 @@ validateCapabilities(Relation rel, ...@@ -1318,22 +1293,31 @@ validateCapabilities(Relation rel,
if (IsResGroupActivated() && if (IsResGroupActivated() &&
gp_resource_group_enable_cgroup_cpuset) gp_resource_group_enable_cgroup_cpuset)
{ {
Bitmapset *bmsAll = NULL;
/* Get all available cores */ /* Get all available cores */
ResGroupOps_GetCpuSet(RESGROUP_ROOT_ID, ResGroupOps_GetCpuSet(RESGROUP_ROOT_ID,
cpusetAll, cpusetAll,
MaxCpuSetLength); MaxCpuSetLength);
bmsUnused = CpusetToBitset(cpusetAll, MaxCpuSetLength); bmsAll = CpusetToBitset(cpusetAll, MaxCpuSetLength);
/* Check whether the cores in this group are available */ /* Check whether the cores in this group are available */
if (!CpusetIsEmpty(caps->cpuset)) if (!CpusetIsEmpty(caps->cpuset))
{ {
Bitmapset *bmsMissing = NULL;
bmsCurrent = CpusetToBitset(caps->cpuset, MaxCpuSetLength); bmsCurrent = CpusetToBitset(caps->cpuset, MaxCpuSetLength);
if (!bms_is_subset(bmsCurrent, bmsUnused)) bmsCommon = bms_intersect(bmsCurrent, bmsAll);
bmsMissing = bms_difference(bmsCurrent, bmsCommon);
if (!bms_is_empty(bmsMissing))
{ {
BitsetToCpuset(bmsMissing, cpusetMissing, MaxCpuSetLength);
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("some cores of cpuset are unavailable"))); errmsg("cpu cores %s are unavailable on the system",
cpusetMissing)));
} }
bmsUnused = bms_del_members(bmsUnused, bmsCurrent);
} }
} }
...@@ -1402,28 +1386,29 @@ validateCapabilities(Relation rel, ...@@ -1402,28 +1386,29 @@ validateCapabilities(Relation rel,
/* /*
* do the check when resource group is activated * do the check when resource group is activated
*/ */
if (IsResGroupActivated()) if (IsResGroupActivated() && !CpusetIsEmpty(caps->cpuset))
{ {
proposedStr = TextDatumGetCString(proposedDatum); proposedStr = TextDatumGetCString(proposedDatum);
if (!CpusetIsEmpty(proposedStr)) if (!CpusetIsEmpty(proposedStr))
{ {
if (gp_resource_group_enable_cgroup_cpuset) Bitmapset *bmsOther = NULL;
{
bmsCurrent = CpusetToBitset(proposedStr, MaxCpuSetLength); EnsureCpusetIsAvailable(ERROR);
if (!bms_is_subset(bmsCurrent, bmsUnused))
{ Assert(!bms_is_empty(bmsCurrent));
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), bmsOther = CpusetToBitset(proposedStr, MaxCpuSetLength);
errmsg("some cores of cpuset are unavailable"))); bmsCommon = bms_intersect(bmsCurrent, bmsOther);
}
bmsUnused = bms_del_members(bmsUnused, bmsCurrent); if (!bms_is_empty(bmsCommon))
}
else
{ {
BitsetToCpuset(bmsCommon, cpusetMissing, MaxCpuSetLength);
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cpuset is disabled for cpuset/gpdb " errmsg("cpu cores %s are used by resource group %s",
"does not exist"))); cpusetMissing,
GetResGroupNameForId(resgroupid))));
} }
} }
} }
......
...@@ -588,16 +588,27 @@ InitResGroups(void) ...@@ -588,16 +588,27 @@ InitResGroups(void)
} }
else else
{ {
if (gp_resource_group_enable_cgroup_cpuset)
{
bool allCoreAvailable = true;
Bitmapset *bmsCurrent = CpusetToBitset(caps.cpuset, Bitmapset *bmsCurrent = CpusetToBitset(caps.cpuset,
MaxCpuSetLength); MaxCpuSetLength);
Bitmapset *bmsCommon = bms_intersect(bmsCurrent, bmsUnused);
Bitmapset *bmsMissing = bms_difference(bmsCurrent, bmsCommon);
/*
* Do not call EnsureCpusetIsAvailable() here as resource group is
* not activated yet
*/
if (!gp_resource_group_enable_cgroup_cpuset)
{
ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cgroup is not properly configured to use the cpuset feature"),
errhint("Extra cgroup configurations are required to enable this feature, "
"please refer to the Greenplum Documentations for details")));
}
Assert(caps.cpuRateLimit == CPU_RATE_LIMIT_DISABLED); Assert(caps.cpuRateLimit == CPU_RATE_LIMIT_DISABLED);
allCoreAvailable = bms_is_subset(bmsCurrent, bmsUnused); if (bms_is_empty(bmsMissing))
if (allCoreAvailable)
{ {
/* /*
* write cpus to corresponding file * write cpus to corresponding file
...@@ -608,6 +619,8 @@ InitResGroups(void) ...@@ -608,6 +619,8 @@ InitResGroups(void)
} }
else else
{ {
char cpusetMissing[MaxCpuSetLength] = {0};
/* /*
* if some of the cores are unavailable, just set defaultCore * if some of the cores are unavailable, just set defaultCore
* to this group and send a warning message, so the system * to this group and send a warning message, so the system
...@@ -615,22 +628,17 @@ InitResGroups(void) ...@@ -615,22 +628,17 @@ InitResGroups(void)
*/ */
snprintf(cpuset, MaxCpuSetLength, "%d", defaultCore); snprintf(cpuset, MaxCpuSetLength, "%d", defaultCore);
ResGroupOps_SetCpuSet(groupId, cpuset); ResGroupOps_SetCpuSet(groupId, cpuset);
BitsetToCpuset(bmsMissing, cpusetMissing, MaxCpuSetLength);
ereport(WARNING, ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("some of the cpu cores are unavailable " errmsg("cpu cores %s are unavailable on the system "
"in group(%d), using core(%d) instead", "in resource group %s",
groupId, cpusetMissing, GetResGroupNameForId(groupId)),
errhint("using core %d for this resource group, "
"please adjust the settings and restart",
defaultCore))); defaultCore)));
} }
} }
else
{
ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cpuset is disabled for cpuset/gpdb "
"does not exist")));
}
}
numGroups++; numGroups++;
Assert(numGroups <= MaxResourceGroups); Assert(numGroups <= MaxResourceGroups);
...@@ -751,13 +759,6 @@ ResGroupDropFinish(const ResourceGroupCallbackContext *callbackCtx, ...@@ -751,13 +759,6 @@ ResGroupDropFinish(const ResourceGroupCallbackContext *callbackCtx,
CpusetUnion(cpuset, group->caps.cpuset, MaxCpuSetLength); CpusetUnion(cpuset, group->caps.cpuset, MaxCpuSetLength);
ResGroupOps_SetCpuSet(DEFAULT_CPUSET_GROUP_ID, cpuset); ResGroupOps_SetCpuSet(DEFAULT_CPUSET_GROUP_ID, cpuset);
} }
else
{
ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cpuset is disabled for cpuset/gpdb "
"does not exist")));
}
} }
ResGroupOps_DestroyGroup(callbackCtx->groupid, migrate); ResGroupOps_DestroyGroup(callbackCtx->groupid, migrate);
...@@ -3959,3 +3960,32 @@ CpusetDifference(char *cpuset1, const char *cpuset2, int len) ...@@ -3959,3 +3960,32 @@ CpusetDifference(char *cpuset1, const char *cpuset2, int len)
{ {
cpusetOperation(cpuset1, cpuset2, len, true); cpusetOperation(cpuset1, cpuset2, len, true);
} }
/*
* ensure that cpuset is available.
*/
bool
EnsureCpusetIsAvailable(int elevel)
{
if (!IsResGroupActivated())
{
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("resource group must be enabled to use cpuset feature")));
return false;
}
if (!gp_resource_group_enable_cgroup_cpuset)
{
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cgroup is not properly configured to use the cpuset feature"),
errhint("Extra cgroup configurations are required to enable this feature, "
"please refer to the Greenplum Documentations for details")));
return false;
}
return true;
}
...@@ -183,6 +183,7 @@ extern void CpusetUnion(char *cpuset1, const char *cpuset2, int len); ...@@ -183,6 +183,7 @@ extern void CpusetUnion(char *cpuset1, const char *cpuset2, int len);
extern void CpusetDifference(char *cpuset1, const char *cpuset2, int len); extern void CpusetDifference(char *cpuset1, const char *cpuset2, int len);
extern bool CpusetIsEmpty(const char *cpuset); extern bool CpusetIsEmpty(const char *cpuset);
extern void SetCpusetEmpty(char *cpuset, int cpusetSize); extern void SetCpusetEmpty(char *cpuset, int cpusetSize);
extern bool EnsureCpusetIsAvailable(int elevel);
#define LOG_RESGROUP_DEBUG(...) \ #define LOG_RESGROUP_DEBUG(...) \
do {if (Debug_resource_group) elog(__VA_ARGS__); } while(false); do {if (Debug_resource_group) elog(__VA_ARGS__); } while(false);
......
...@@ -144,7 +144,7 @@ CREATE RESOURCE GROUP rg_test_group WITH (cpuset=' 0 ', memory_limit=5); ...@@ -144,7 +144,7 @@ CREATE RESOURCE GROUP rg_test_group WITH (cpuset=' 0 ', memory_limit=5);
ERROR: cpuset invalid ERROR: cpuset invalid
---- suppose the core numbered 1024 is not exist ---- suppose the core numbered 1024 is not exist
CREATE RESOURCE GROUP rg_test_group WITH (cpuset='1024', memory_limit=5); CREATE RESOURCE GROUP rg_test_group WITH (cpuset='1024', memory_limit=5);
ERROR: some cores of cpuset are unavailable ERROR: cpu cores 1024 are unavailable on the system
CREATE RESOURCE GROUP rg_test_group WITH (cpuset='0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', memory_limit=5);
ERROR: the length of cpuset reached the upper limit 1024 ERROR: the length of cpuset reached the upper limit 1024
-- can't alter to invalid cpuset -- can't alter to invalid cpuset
...@@ -170,7 +170,7 @@ ALTER RESOURCE GROUP rg_test_group set CPUSET ' 0 '; ...@@ -170,7 +170,7 @@ ALTER RESOURCE GROUP rg_test_group set CPUSET ' 0 ';
ERROR: cpuset invalid ERROR: cpuset invalid
---- suppose the core numbered 1024 is not exist ---- suppose the core numbered 1024 is not exist
ALTER RESOURCE GROUP rg_test_group set CPUSET '1024'; ALTER RESOURCE GROUP rg_test_group set CPUSET '1024';
ERROR: some cores of cpuset are unavailable ERROR: cpu cores 1024 are unavailable on the system
ALTER RESOURCE GROUP rg_test_group set CPUSET '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,';
ERROR: the length of cpuset reached the upper limit 1024 ERROR: the length of cpuset reached the upper limit 1024
DROP RESOURCE GROUP rg_test_group; DROP RESOURCE GROUP rg_test_group;
...@@ -249,7 +249,7 @@ ERROR: resource group concurrency must be 0 when group memory_auditor is cgroup ...@@ -249,7 +249,7 @@ ERROR: resource group concurrency must be 0 when group memory_auditor is cgroup
CREATE RESOURCE GROUP rg_test_group1 WITH (cpuset='0', memory_limit=10); CREATE RESOURCE GROUP rg_test_group1 WITH (cpuset='0', memory_limit=10);
CREATE CREATE
CREATE RESOURCE GROUP rg_test_group2 WITH (cpuset='0', memory_limit=10); CREATE RESOURCE GROUP rg_test_group2 WITH (cpuset='0', memory_limit=10);
ERROR: some cores of cpuset are unavailable ERROR: cpu cores 0 are used by resource group rg_test_group1
DROP RESOURCE GROUP rg_test_group1; DROP RESOURCE GROUP rg_test_group1;
DROP DROP
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
-- Test: cpuset cannot be specified when group is disabled. -- Test: cpuset cannot be specified when group is disabled.
-- --
CREATE RESOURCE GROUP resource_group1 WITH (memory_limit=5, cpuset='0'); CREATE RESOURCE GROUP resource_group1 WITH (memory_limit=5, cpuset='0');
ERROR: must specify cpuset when resource group is activated ERROR: resource group must be enabled to use cpuset feature
CREATE RESOURCE GROUP resource_group1 WITH (memory_limit=5, cpu_rate_limit=5); CREATE RESOURCE GROUP resource_group1 WITH (memory_limit=5, cpu_rate_limit=5);
WARNING: resource group is disabled WARNING: resource group is disabled
HINT: To enable set gp_resource_manager=group HINT: To enable set gp_resource_manager=group
ALTER RESOURCE GROUP resource_group1 SET cpuset '0'; ALTER RESOURCE GROUP resource_group1 SET cpuset '0';
ERROR: must specify cpuset when resource group is activated ERROR: resource group must be enabled to use cpuset feature
DROP RESOURCE GROUP resource_group1; DROP RESOURCE GROUP resource_group1;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册