Please answer these questions before submitting your issue. Thanks!
- What did you do?
If possible, provide a recipe for reproducing the error.
docker deploy TiDB cluster, then start same shell script from two servers at the same time.
for each script:
"show database like XXX"
if the database doesn't exist then "create database XXX"
- What did you expect to see?
only one agent could create the DB, and TiDB should return success from that agent.
- What did you see instead?
At the beginning, I can see mysql connection timeout errors, and also connection refused errors later
After several times retries(around 30s later, mysql client connected successfully)
both agent got empty result for "show databases XXX", that means the db doesn't exist.
both agent start to create same DB
both agent got "failed, the database already exists"
Got exactly same log from my script from two servers, interesting show database command took around 5s to complete
2018-07-02 09:18:47 show databases like 'grafana';
2018-07-02 09:18:53 DB doesn't exist, create it first
2018-07-02 09:18:54 ERROR 1007 (HY000) at line 1: Can't create database 'grafana'; database exists
- What version of TiDB are you using (
tidb-server -V or run select tidb_version(); on TiDB)?
v2.04
Note: can't hit this issue every time, roughly 1 from 20
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
docker deploy TiDB cluster, then start same shell script from two servers at the same time.
for each script:
"show database like XXX"
if the database doesn't exist then "create database XXX"
only one agent could create the DB, and TiDB should return success from that agent.
At the beginning, I can see mysql connection timeout errors, and also connection refused errors later
After several times retries(around 30s later, mysql client connected successfully)
both agent got empty result for "show databases XXX", that means the db doesn't exist.
both agent start to create same DB
both agent got "failed, the database already exists"
Got exactly same log from my script from two servers, interesting show database command took around 5s to complete
tidb-server -Vor runselect tidb_version();on TiDB)?v2.04
Note: can't hit this issue every time, roughly 1 from 20