Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of legacy volume move #1895

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,17 @@ resync-consensus() {
else
__cl_volume="$(basename "$(realpath .)")_${__cl_volume}"
dodocker volume rm "$(dodocker volume ls -q -f "name=${__cl_volume}")"
__volume_id=""
if [[ "${__cl_volume}" =~ lhconsensus-data ]]; then
__legacy_volume="$(basename "$(realpath .)")_lhbeacon-data"
__volume_id="$(dodocker volume ls -q -f "name=${__legacy_volume}")"
elif [[ "${__cl_volume}" =~ prysmconsensus-data ]]; then
__legacy_volume="$(basename "$(realpath .)")_prysmbeacon-data"
__volume_id="$(dodocker volume ls -q -f "name=${__legacy_volume}")"
fi
if [ -n "${__volume_id}" ]; then
dodocker volume rm "${__volume_id}"
fi
fi
echo
echo "${__cl_client} stopped and database deleted."
Expand Down
5 changes: 3 additions & 2 deletions lighthouse/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ fi
if [[ -d /var/lib/lighthouse-og/beacon && ! -f /var/lib/lighthouse-og/beacon/migrationdone \
&& $(ls -A /var/lib/lighthouse-og/beacon/) ]]; then
echo "Migrating from old Lighthouse volume to new one"
echo "This may take 10 minutes on a fast drive. Please be patient"
rsync -a --remove-source-files --exclude='ee-secret' /var/lib/lighthouse-og/beacon/ /var/lib/lighthouse/beacon/
echo "This may take 10 minutes on a fast drive, or hours if the Lighthouse DB is very large. Please be patient"
echo "If your Lighthouse DB is well over 200 GiB in size, please consider \"./ethd resync-consensus\""
rsync -a --remove-source-files --exclude='ee-secret' --info=progress2 /var/lib/lighthouse-og/beacon/ /var/lib/lighthouse/beacon/
touch /var/lib/lighthouse-og/beacon/migrationdone
echo "Migration completed, data is now in volume \"lhconsensus-data\""
fi
Expand Down
5 changes: 3 additions & 2 deletions prysm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ fi
if [[ -d /var/lib/prysm-og && ! -f /var/lib/prysm-og/migrationdone \
&& $(ls -A /var/lib/prysm-og/) ]]; then
echo "Migrating from old Prysm volume to new one"
echo "This may take 10 minutes on a fast drive. Please be patient"
rsync -a --remove-source-files --exclude='ee-secret' /var/lib/prysm-og/ /var/lib/prysm/
echo "This may take 10 minutes on a fast drive, or hours if the Prysm DB is very large. Please be patient"
echo "If your Prysm DB is well over 200 GiB in size, please consider \"./ethd resync-consensus\""
rsync -a --remove-source-files --exclude='ee-secret' --info=progress2 /var/lib/prysm-og/ /var/lib/prysm/
touch /var/lib/prysm-og/migrationdone
echo "Migration completed, data is now in volume \"prysmconsensus-data\""
fi
Expand Down