Skip to content

Commit 0079c87

Browse files
Merge pull request #1359 from tjungblu/bumprevX
ETCD-698: rev bump in --force-new-cluster
2 parents 7d0e358 + 7a5c891 commit 0079c87

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

bindata/etcd/quorum-restore-pod.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,24 @@ spec:
2121
#!/bin/sh
2222
set -euo pipefail
2323
24+
export REV_JSON="/var/lib/etcd/revision.json"
25+
26+
if [ -n "$(ls -A "${REV_JSON}")" ]; then
27+
# this will bump by the amount of 20% of the last known live revision.
28+
BUMP_REV=$(jq -r "(.maxRaftIndex*0.2|floor)" "${REV_JSON}")
29+
echo "bumping revisions by ${BUMP_REV}"
30+
else
31+
# 1bn would be an etcd running at 1000 writes/s for about eleven days.
32+
echo "no revision.json found, assuming a 1bn revision bump"
33+
BUMP_REV=1000000000
34+
fi
35+
2436
set -x
2537
exec etcd \
2638
--logger=zap \
2739
--log-level=${VERBOSITY} \
2840
--force-new-cluster \
41+
--force-new-cluster-bump-amount="${BUMP_REV}" \
2942
--name="${NODE_NODE_ENVVAR_NAME_ETCD_NAME}" \
3043
--initial-cluster="${NODE_NODE_ENVVAR_NAME_ETCD_NAME}=https://${NODE_NODE_ENVVAR_NAME_ETCD_URL_HOST}:2380" \
3144
--initial-advertise-peer-urls=https://${NODE_NODE_ENVVAR_NAME_IP}:2380 \

pkg/operator/etcd_assets/bindata.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)