Skip to content

Commit

Permalink
[PLAT-16142] Cgroup gflag set when only using user intent
Browse files Browse the repository at this point in the history
Summary:
postmaster gflag needs to get set when cgroup size is provided
only in user intent, rather then also needing
runtime configs to be set.

Test Plan:
tested setting cgroup with user intent
tested setting cgroup with runtime flag
both succeeded

Reviewers: muthu, daniel

Reviewed By: daniel

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D40158
  • Loading branch information
shubin-yb committed Nov 21, 2024
1 parent f557bbd commit 07db279
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,20 @@ public static Map<String, String> getAllDefaultGFlags(
if (processType == null) {
extra_gflags.put(MASTER_ADDRESSES, "");
} else if (processType.equals(UniverseTaskBase.ServerType.TSERVER.name())) {
boolean configCgroup = config.getInt(NodeManager.POSTGRES_MAX_MEM_MB) > 0;
Integer cgroupSize = userIntent.getCGroupSize(node);
boolean configCgroup =
(cgroupSize != null && cgroupSize > 0)
|| config.getInt(NodeManager.POSTGRES_MAX_MEM_MB) > 0;

// If the cluster is a read replica, use the read replica max mem value if its >= 0. -1 means
// to use the primary cluster value instead.
if (universe.getUniverseDetails().getClusterByUuid(taskParam.placementUuid).clusterType
== UniverseDefinitionTaskParams.ClusterType.ASYNC
&& confGetter.getStaticConf().getInt(NodeManager.POSTGRES_RR_MAX_MEM_MB) >= 0) {
configCgroup = config.getInt(NodeManager.POSTGRES_RR_MAX_MEM_MB) > 0;
&& ((cgroupSize != null && cgroupSize >= 0)
|| confGetter.getStaticConf().getInt(NodeManager.POSTGRES_RR_MAX_MEM_MB) >= 0)) {
configCgroup =
userIntent.getCGroupSize(node) > 0
|| config.getInt(NodeManager.POSTGRES_RR_MAX_MEM_MB) > 0;
}
long historyRetentionBufferSecs =
confGetter.getConfForScope(
Expand Down

0 comments on commit 07db279

Please sign in to comment.