Skip to content

Bug Report: examples 101 execution is not idempotent, fails to run on existing setup #13372

@shlomi-noach

Description

@shlomi-noach

Overview of the Issue

When running 101_initial_cluster.sh on a non-empty $VTDATAROOT setup, the example fails to run:

add /vitess/global
add /vitess/zone1
add zone1 CellInfo
Error:  105: Key already exists (/vitess/zone1) [6]
Error:  105: Key already exists (/vitess/global) [6]
E0625 06:47:45.565984 3912600 vtctl.go:168] action failed: VtctldCommand node already exists: /vitess/global/cells/zone1/CellInfo
etcd start done...
Starting vtctld...
vtctld is running!
E0625 06:47:45.738598 3912666 main.go:56] rpc error: code = Unknown desc = node already exists: /vitess/global/keyspaces/commerce/Keyspace
ERROR: Failed to create and configure the commerce keyspace

"Examples" execution should be idempotent, It should be possible to run on top of an existing cluster.

Also, CI needs to validate that.

Reproduction Steps

Run the below:

rm -rf /tmp/examples
cp -R examples /tmp/

cd /tmp/examples/local
cp ../common/env.sh .
./101_initial_cluster.sh || exit 1
echo 'export PS1="\[\033[38;5;11m\]\u@\h\[$(tput sgr0)\]: \[$(tput sgr0)\]\[\033[38;5;12m\]\w\[$(tput sgr0)\]\\$ \[$(tput sgr0)\]"' >> ./env.sh
/bin/bash --rcfile ./env.sh -i # go interactive
#
# at this point 101 is running., Exit via ^D
#
pkill -9 -e -f '(vtdataroot|VTDATAROOT)' # kill Vitess processes

Then, run the above again.

Binary Version

v17

Operating System and Environment details

-

Log Fragments

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions