Skip to content

Commit 108e3b1

Browse files
Robert Marshallstanhu
andcommitted
Merge branch 'sh-drop-unmigrated-data-check' into 'master'
Drop legacy unmigrated data checks See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7207 Merged-by: Robert Marshall <[email protected]> Approved-by: Robert Marshall <[email protected]> Reviewed-by: Robert Marshall <[email protected]> Co-authored-by: Stan Hu <[email protected]>
2 parents 18c7d52 + f6ab1c8 commit 108e3b1

File tree

2 files changed

+0
-92
lines changed

2 files changed

+0
-92
lines changed

config/templates/package-scripts/preinst.erb

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ mkdir -p /var/log/gitlab/reconfigure
99

1010
skip_backup_file=/etc/gitlab/skip-auto-backup
1111
skip_reconfigure_file=/etc/gitlab/skip-auto-reconfigure
12-
skip_unmigrated_data_check=/etc/gitlab/skip-unmigrated-data-check
1312

1413
# environment may contain these - clear them out
1514
OLD_VERSION_STRING=""
@@ -87,48 +86,6 @@ pg_check() {
8786
fi
8887
}
8988

90-
unmigrated_data_check() {
91-
if [ -e "${skip_unmigrated_data_check}" ] ; then
92-
# The user wants us to do nothing
93-
return
94-
fi
95-
96-
if ( [ ! -d ${DEST_DIR}/service/puma ] && [ ! -d ${DEST_DIR}/service/sidekiq ] ); then
97-
notify
98-
notify "This node does not appear to be running puma and/or sidekiq services"
99-
notify "Skipping unmigrated data check, if you think this is an error exit now"
100-
notify
101-
return
102-
fi
103-
104-
notify "Checking for unmigrated data on legacy storage"
105-
output=$(gitlab-rake gitlab:storage:legacy_attachments gitlab:storage:legacy_projects 2>&1);
106-
107-
if [ $? -ne 0 ]; then
108-
notify
109-
notify "Upgrade failed. Could not check for unmigrated data on legacy storage."
110-
notify
111-
notify "${output}"
112-
unmigrated_data_check_failed
113-
fi
114-
115-
if ! (echo $output | grep 'Found 0 attachments' && echo $output | grep 'Found 0 projects') > /dev/null 2>&1; then
116-
notify
117-
notify "Legacy storage is no longer supported. Please migrate your data to hashed storage."
118-
notify "Check https://docs.gitlab.com/ee/administration/raketasks/storage.html#migrate-to-hashed-storage for details."
119-
unmigrated_data_check_failed
120-
fi
121-
}
122-
123-
unmigrated_data_check_failed() {
124-
notify
125-
notify "If you want to skip this check, run the following command and try again:"
126-
notify
127-
notify " sudo touch ${skip_unmigrated_data_check}"
128-
notify
129-
exit 1
130-
}
131-
13289
main() {
13390
if [ -e "${skip_reconfigure_file}" ] ; then
13491
# The user wants us to do nothing
@@ -174,15 +131,13 @@ case "$1" in
174131
upgrade_check
175132
config_check
176133
pg_check
177-
unmigrated_data_check
178134
main
179135
;;
180136
upgrade)
181137
# Looks like a DEB upgrade
182138
upgrade_check
183139
config_check
184140
pg_check
185-
unmigrated_data_check
186141
main
187142
;;
188143
*)

docker/assets/wrapper

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,6 @@ function detect_unclean_start() {
4444
set -e
4545
}
4646

47-
# Make sure that there is no unmigrated data to hashed storage.
48-
function unmigrated_data_check() {
49-
set +e
50-
51-
echo "Checking for unmigrated data on legacy storage"
52-
found=$(MAX_DATABASE_CONNECTION_CHECKS=5 gitlab-rake gitlab:storage:legacy_attachments gitlab:storage:legacy_projects 2>&1);
53-
54-
if [ $? -ne 0 ]; then
55-
echo "Upgrade failed. Could not check for unmigrated data on legacy storage."
56-
echo ""
57-
echo $found
58-
echo ""
59-
echo ""
60-
echo "If you would like to restart the instance without performing this"
61-
echo "check, add the following to your docker command:"
62-
echo "-e GITLAB_SKIP_UNMIGRATED_DATA_CHECK=true"
63-
echo ""
64-
exit 1
65-
fi
66-
67-
if ! (echo $found | grep 'Found 0 attachments' && echo $found | grep 'Found 0 projects') > /dev/null 2>&1; then
68-
echo
69-
echo "Legacy storage is no longer supported. Please migrate your data to hashed storage."
70-
echo "Check https://docs.gitlab.com/ee/administration/raketasks/storage.html#migrate-to-hashed-storage for details."
71-
echo ""
72-
echo "Upgrade failed. Retry the upgrade after migrating your data to hashed storage."
73-
exit 1
74-
fi
75-
76-
set -e
77-
}
78-
7947
trap "sigterm_handler; exit" TERM
8048

8149
source /RELEASE
@@ -179,21 +147,6 @@ GITLAB_OMNIBUS_CONFIG= /opt/gitlab/embedded/bin/runsvdir-start &
179147
echo "Configuring GitLab..."
180148
gitlab-ctl reconfigure
181149

182-
# Skip unmigrated data check if Puma and Sidekiq is not running
183-
if [ ! -d /opt/gitlab/service/puma ] && [ ! -d /opt/gitlab/service/sidekiq ]; then
184-
echo
185-
echo "This node does not appear to be running puma and/or sidekiq services"
186-
echo "Skipping unmigrated data check, if you think this is an error exit now"
187-
echo
188-
189-
GITLAB_SKIP_UNMIGRATED_DATA_CHECK='true'
190-
fi
191-
192-
# Check if there are no unmigrated data to hashed storage if it is an upgrade
193-
if [ "${GITLAB_UPGRADE}" == 'true' -a "${GITLAB_SKIP_UNMIGRATED_DATA_CHECK}" != 'true' ]; then
194-
unmigrated_data_check
195-
fi
196-
197150
# This must be false when the opt-in PostgreSQL version is the default for pg-upgrade,
198151
# otherwise it must be true.
199152
ATTEMPT_AUTO_PG_UPGRADE='false'

0 commit comments

Comments
 (0)