2
0
Fork 0

fix(zk): Fix zookeper upgrade to 5.5.0 (#511)

Fixes the "logs found but no snapshot" error when upgrading from a
short-lived older version. Fixes #472.

See https://issues.apache.org/jira/browse/ZOOKEEPER-3056.
This commit is contained in:
Burak Yigit Kaya 2020-05-24 23:52:30 +03:00 committed by GitHub
parent 9793bb7157
commit fe1f23f10f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -164,6 +164,16 @@ $dc build --force-rm --parallel
echo ""
echo "Docker images built."
ZOOKEEPER_LOG_FILE_COUNT=$($dcr zookeeper bash -c 'ls 2>/dev/null -Ubad1 -- /var/lib/zookeeper/log/version-2/* | wc -l | tr -d '[:space:]'')
ZOOKEEPER_SNAPSHOT_FILE_COUNT=$($dcr zookeeper bash -c 'ls 2>/dev/null -Ubad1 -- /var/lib/zookeeper/data/version-2/* | wc -l | tr -d '[:space:]'')
# This is a workaround for a ZK upgrade bug: https://issues.apache.org/jira/browse/ZOOKEEPER-3056
if [ "$ZOOKEEPER_LOG_FILE_COUNT" -gt "0" ] && [ "$ZOOKEEPER_SNAPSHOT_FILE_COUNT" -eq "0" ]; then
$dcr -v $(pwd)/zookeeper:/temp zookeeper bash -c 'cp /temp/snapshot.0 /var/lib/zookeeper/data/version-2/snapshot.0'
$dc run -e ZOOKEEPER_SNAPSHOT_TRUST_EMPTY=true zookeeper
fi
echo "Bootstrapping and migrating Snuba..."
$dcr snuba-api bootstrap --force
echo ""

BIN
zookeeper/snapshot.0 Normal file

Binary file not shown.