This is an automated email from the ASF dual-hosted git repository.
yjhjstz pushed a commit to branch REL_2_STABLE
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/REL_2_STABLE by this push:
new db9e849da44 Fix: gpexpand to automatically set data directory
permissions to 0750
db9e849da44 is described below
commit db9e849da446699f6604c306893319b2a9ac0c38
Author: MutableFire <[email protected]>
AuthorDate: Mon Jul 13 13:48:51 2026 +0300
Fix: gpexpand to automatically set data directory permissions to 0750
Injects logic into the `_configure_new_segments` method of `gpexpand`
to automatically correct segment data directory permissions during
cluster expansion.
---
gpMgmt/bin/gpexpand | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gpMgmt/bin/gpexpand b/gpMgmt/bin/gpexpand
index dcbed918a19..1d36a5a563e 100755
--- a/gpMgmt/bin/gpexpand
+++ b/gpMgmt/bin/gpexpand
@@ -846,6 +846,24 @@ class SegmentTemplate:
# and mirror information
update_pg_hba_on_segments(self.gparray, self.isHbaHostnames,
self.batch_size, expanded_host_content)
+ new_segments = self.gparray.getExpansionSegDbList()
+ chmod_commands_by_host = defaultdict(list)
+
+ for seg in new_segments:
+ if seg.isSegmentMirror():
+ continue
+ datadir = seg.getSegmentDataDirectory()
+ hostname = seg.getSegmentHostName()
+ chmod_commands_by_host[hostname].append("chmod 0750 '%s'" %
datadir)
+
+ for host, commands in chmod_commands_by_host.items():
+ if commands:
+ self.pool.addCommand(Command(name='gpexpand fix permissions on
%s' % host,
+ cmdStr=" && ".join(commands), ctxt=REMOTE,
remoteHost=host))
+
+ self.pool.join()
+ self.pool.check_results()
+
self._start_new_primary_segments()
self._stop_new_primary_segments()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]