From 108c5dbc5831671dc0d62199765063cf8e1237d2 Mon Sep 17 00:00:00 2001 From: zengxs Date: Mon, 30 Oct 2023 18:45:19 +0800 Subject: [PATCH] GH-53: merge upstream --- assets/wrapper | 49 +------------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/assets/wrapper b/assets/wrapper index 53120af..6944e90 100755 --- a/assets/wrapper +++ b/assets/wrapper @@ -44,38 +44,6 @@ function detect_unclean_start() { set -e } -# Make sure that there is no unmigrated data to hashed storage. -function unmigrated_data_check() { - set +e - - echo "Checking for unmigrated data on legacy storage" - found=$(MAX_DATABASE_CONNECTION_CHECKS=5 gitlab-rake gitlab:storage:legacy_attachments gitlab:storage:legacy_projects 2>&1); - - if [ $? -ne 0 ]; then - echo "Upgrade failed. Could not check for unmigrated data on legacy storage." - echo "" - echo $found - echo "" - echo "" - echo "If you would like to restart the instance without performing this" - echo "check, add the following to your docker command:" - echo "-e GITLAB_SKIP_UNMIGRATED_DATA_CHECK=true" - echo "" - exit 1 - fi - - if ! (echo $found | grep 'Found 0 attachments' && echo $found | grep 'Found 0 projects') > /dev/null 2>&1; then - echo - echo "Legacy storage is no longer supported. Please migrate your data to hashed storage." - echo "Check https://docs.gitlab.com/ee/administration/raketasks/storage.html#migrate-to-hashed-storage for details." - echo "" - echo "Upgrade failed. Retry the upgrade after migrating your data to hashed storage." - exit 1 - fi - - set -e -} - trap "sigterm_handler; exit" TERM source /RELEASE @@ -119,7 +87,7 @@ if old_version=$(cat /var/opt/gitlab/gitlab-rails/VERSION) then GITLAB_UPGRADE='true' new_version=$(awk '/^gitlab-(ce|ee|jh)/ {print $NF}' /opt/gitlab/version-manifest.txt) - MIN_VERSION="15.11" gitlab-ctl upgrade-check "${old_version}" "${new_version}" + gitlab-ctl upgrade-check "${old_version}" "${new_version}" fi # Copy gitlab.rb for the first time @@ -179,21 +147,6 @@ GITLAB_OMNIBUS_CONFIG= /opt/gitlab/embedded/bin/runsvdir-start & echo "Configuring GitLab..." gitlab-ctl reconfigure -# Skip unmigrated data check if Puma and Sidekiq is not running -if [ ! -d /opt/gitlab/service/puma ] && [ ! -d /opt/gitlab/service/sidekiq ]; then - echo - echo "This node does not appear to be running puma and/or sidekiq services" - echo "Skipping unmigrated data check, if you think this is an error exit now" - echo - - GITLAB_SKIP_UNMIGRATED_DATA_CHECK='true' -fi - -# Check if there are no unmigrated data to hashed storage if it is an upgrade -if [ "${GITLAB_UPGRADE}" == 'true' -a "${GITLAB_SKIP_UNMIGRATED_DATA_CHECK}" != 'true' ]; then - unmigrated_data_check -fi - # This must be false when the opt-in PostgreSQL version is the default for pg-upgrade, # otherwise it must be true. ATTEMPT_AUTO_PG_UPGRADE='false'