Skip to content

multiple instances of tidb-server may use the same temporary directory #13981

Closed
@SunRunAway

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.

Multiple instances of tidb-server may use the same temporary directy.
See

var tmpDir = filepath.Join(os.TempDir(), "tidb-server-"+filepath.Base(os.Args[0]))
, if two of tidb-servers have same instance name but in different directory, each of them will share the same folder and the next start of one instance will remove this directory so that another instance may face unexpected problem.

  1. What did you expect to see?
  • different instances in on node use different directories.
  • if one tidb-server uses a temporary directory which another is in use, it should panic.
  • When tidb-server starts, find a way to safely remove the temporary directory created when it last starts.
  • We need ensure that tidb-server instance has the READ/WRITE privilege for the directory, otherwise, panic when starts up.
  1. What did you see instead?

  2. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

4.0.0-alpha

Metadata

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.sig/executionSIG executiontype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions