Last active
March 24, 2017 17:29
-
-
Save banks/6d8dc07180cd5dc86d7510b2b39656b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./grpc_proxy_bug.sh | |
Putting /grpc_proxy_bug/001 | |
OK | |
Putting /grpc_proxy_bug/002 | |
OK | |
Putting /grpc_proxy_bug/003 | |
OK | |
Putting /grpc_proxy_bug/004 | |
OK | |
Putting /grpc_proxy_bug/005 | |
OK | |
Putting /grpc_proxy_bug/006 | |
OK | |
Putting /grpc_proxy_bug/007 | |
OK | |
Putting /grpc_proxy_bug/008 | |
OK | |
Putting /grpc_proxy_bug/009 | |
OK | |
Putting /grpc_proxy_bug/010 | |
OK | |
Compacting to revision 132 | |
compacted revision 132 | |
Putting /grpc_proxy_bug/001 | |
OK | |
Putting /grpc_proxy_bug/003 | |
OK | |
Putting /grpc_proxy_bug/005 | |
OK | |
Putting /grpc_proxy_bug/007 | |
OK | |
Putting /grpc_proxy_bug/009 | |
OK | |
Range read over all the keys: | |
/grpc_proxy_bug/001 | |
Overwrite 1 | |
/grpc_proxy_bug/002 | |
Write 2 | |
/grpc_proxy_bug/003 | |
Overwrite 3 | |
/grpc_proxy_bug/004 | |
Write 4 | |
/grpc_proxy_bug/005 | |
Overwrite 5 | |
/grpc_proxy_bug/006 | |
Write 6 | |
/grpc_proxy_bug/007 | |
Overwrite 7 | |
/grpc_proxy_bug/008 | |
Write 8 | |
/grpc_proxy_bug/009 | |
Overwrite 9 | |
/grpc_proxy_bug/010 | |
Write 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./grpc_proxy_bug.sh | |
Putting /grpc_proxy_bug/001 | |
OK | |
Putting /grpc_proxy_bug/002 | |
OK | |
Putting /grpc_proxy_bug/003 | |
OK | |
Putting /grpc_proxy_bug/004 | |
OK | |
Putting /grpc_proxy_bug/005 | |
OK | |
Putting /grpc_proxy_bug/006 | |
OK | |
Putting /grpc_proxy_bug/007 | |
OK | |
Putting /grpc_proxy_bug/008 | |
OK | |
Putting /grpc_proxy_bug/009 | |
OK | |
Putting /grpc_proxy_bug/010 | |
OK | |
Compacting to revision 117 | |
compacted revision 117 | |
Putting /grpc_proxy_bug/001 | |
OK | |
Putting /grpc_proxy_bug/003 | |
OK | |
Putting /grpc_proxy_bug/005 | |
OK | |
Putting /grpc_proxy_bug/007 | |
OK | |
Putting /grpc_proxy_bug/009 | |
OK | |
Range read over all the keys: | |
Error: etcdserver: mvcc: required revision has been compacted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -ueo pipefail | |
export ETCDCTL_API=3 | |
PFX="/grpc_proxy_bug/" | |
# write to 10 keys in a range | |
for i in $(seq 1 10); do | |
KEY=$(printf "$PFX%03d" $i) | |
echo "Putting $KEY" | |
etcdctl --endpoints=$ETCD_ENDPOINTS --user=$ETCD_USERPASS put $KEY "Write $i" | |
done | |
# now manually compact, this will compact the servers at current index | |
REV=$(etcdctl --endpoints=$ETCD_ENDPOINTS --user=$ETCD_USERPASS endpoint status --write-out="json" |egrep -o '"revision":[0-9]*' | egrep -o '[0-9]+' | head -1) | |
echo "Compacting to revision $REV" | |
etcdctl --endpoints=$ETCD_ENDPOINTS --user=$ETCD_USERPASS compaction --physical $REV | |
# now we write out "seed" data for the next test which is a sparse set of the key range from before | |
# we'll arbitrary pick odd number to write to now | |
for i in $(seq 1 2 10); do | |
KEY=$(printf "$PFX%03d" $i) | |
echo "Putting $KEY" | |
etcdctl --endpoints=$ETCD_ENDPOINTS --user=$ETCD_USERPASS put $KEY "Overwrite $i" | |
done | |
# now range read the range, this should trigger the error compacted version error | |
echo "Range read over all the keys:" | |
etcdctl --endpoints=$ETCD_ENDPOINTS --user=$ETCD_USERPASS get --consistency=s $(printf "$PFX%03d" 1) $(printf "$PFX%03d" 11) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment