Skip to content

DB created successfully but failure returned #6957

@CrazyNash

Description

@CrazyNash

Please answer these questions before submitting your issue. Thanks!

  1. 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"

  1. What did you expect to see?

only one agent could create the DB, and TiDB should return success from that agent.

  1. 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
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/questionThe issue belongs to a question.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions