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:
parent
9793bb7157
commit
fe1f23f10f
10
install.sh
10
install.sh
@ -164,6 +164,16 @@ $dc build --force-rm --parallel
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Docker images built."
|
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..."
|
echo "Bootstrapping and migrating Snuba..."
|
||||||
$dcr snuba-api bootstrap --force
|
$dcr snuba-api bootstrap --force
|
||||||
echo ""
|
echo ""
|
||||||
|
BIN
zookeeper/snapshot.0
Normal file
BIN
zookeeper/snapshot.0
Normal file
Binary file not shown.
Reference in New Issue
Block a user