-
Notifications
You must be signed in to change notification settings - Fork 154
Add TiDB single sandbox support #54
Description
Is your feature request related to a problem? Please describe.
I would like to propose single sandbox support for TiDB, to allow developers to easily test compatibility without having to install a full distributed system (tidb+tikv+pd).
Describe the solution you'd like
TiDB can run with something called mocktikv (goleveldb) instead of tikv, which means that only one server component needs to be setup. In my own testing it is 5x slower than tikv, but the advantage is that you only need a tidb-server setup, and no pd or tikv.
The memory footprint is smaller than MySQL, so it's possible some might even prefer it for development.
Describe alternatives you've considered
I've looked at alternatives installation methods like Homebrew etc, but they do not solve the use case of having multiple versions installed concurrently. The TiDB release schedule is every 6 months, so dbdeployer is really useful in providing a system of organizing binaries for TiDB developers.
Additional context
I have looked at the initial work, and much of it can be implemented by sandbox templates and some core changes that @datacharmer already has planned (discussed at FOSDEM). Let me try and comment in terms of each:
Core
- Requires support for detecting TiDB flavor Define criteria to detect the flavor of a tarball contents #53 unpack command should create a FLAVOR file for the extracted tarball #52
- Requires support for unnumbered tarballs unpack command fails when tarball name doesn't include a version #51
- Requires support for
--client-from(or similar) Add support for --client-from=X #49 - Requires support for 'capabilities' of which TiDB will be only single, with no gtids, binlog (initially), relay log, show log (initially, because there is no general log), add option, semisync, expose dd tables. Change evaluation of version to include a flavor #50
- Tarball inspection for files
lib/libmysqlclient.soandscripts/mysql_install_dbneeds to be moved into either "capabilities" or "flavors".
Templates
I will send a pull request after some discussion, but my initial testing shows that the major template changes are:
- init_db_template
- my_cnf_template
- status_template * may need some discussion due to dependency
- start_template
- stop_template
- Change grants_template to be based on grants_template57 (TiDB has no_auto_create_user too)
TBD:
I think that these two templates can be kept vanila assuming support for --client-from is added:
my_template- use_template