This is an automated email from the ASF dual-hosted git repository.
leborchuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new 7d9a3621ce5 Fix: gpexpand to automatically set data directory
permissions to 0750 (#1848)
7d9a3621ce5 is described below
commit 7d9a3621ce52febbb514c30528be535d852bf7d8
Author: Sagittarius <[email protected]>
AuthorDate: Thu Sep 3 14:48:38 2026 +0300
Fix: gpexpand to automatically set data directory permissions to 0750
(#1848)
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]