Skip to content

Commit f14f8dd

Browse files
committed
Clarify special handling for cluster environments
1 parent 79d4875 commit f14f8dd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

share/github-backup-utils/ghe-restore-repositories

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ done > $tmp_list
102102
IFS=$OLDIFS
103103
bm_end "$(basename $0) - Building network list"
104104

105+
# In cluster environments, we need to ensure that all repository networks are replicated back to the
106+
# same Spokes nodes that they were present on when the backup was taken. For this, the list of
107+
# routes of each repository network is first obtained. Afterward, an rsync file list is created for
108+
# each Spokes node including only those repository networks for which there was a route to the
109+
# respective Spokes node.
105110
if $CLUSTER; then
106111
# The server returns a list of routes:
107112
#
@@ -140,9 +145,11 @@ if $CLUSTER; then
140145
cat $routes_list | awk '{ n = split($1, p, "/"); printf p[n] " /data/repositories/" $1; $1=""; print $0}' > $to_restore
141146
ghe_debug "\n$(find "$tempdir" -maxdepth 1 -name '*.rsync')"
142147
bm_end "$(basename $0) - Processing routes"
148+
# There is no need to collect routes and split them by Spokes server in noncluster setups because
149+
# we need to transfer all repository networks to the primary instance unconditionally, regardless of
150+
# the Spokes route list captured during the backup. As we already have the list of all repository
151+
# network paths, we can simply use that as the rsync file list in noncluster environments.
143152
else
144-
# In noncluster setups, the primary instance owns all repository networks, so all network paths
145-
# are to be synchronized to the primary instance.
146153
cp "$tmp_list" "$tempdir/git-server-primary.rsync"
147154
fi
148155

0 commit comments

Comments
 (0)