Mattias Jonsson eb35c773b5 ddl: avoid commit conflicts when updating/delete from mysql.tidb_ddl_reorg. (#38738)
* Added test case

* ddl fix #38669.

The issue was that mysql.tidb_ddl_reorg table was updated by an
inner transaction after the outer transaction started,
which then made a commit conflict in the outer transaction,
when it deleted the same row.

* Fixed typo in comment

* Added test case for #24427

* Disabled tests for CI testing

* Revert "Disabled tests for CI testing"

This reverts commit 17c28f30ba8802c578fed5653107aa6995e17607.

* Revert "Revert "Disabled tests for CI testing""

This reverts commit 65c84d94f7ab4440c739703312f5329619c6ccdc.

* removed test skips

* Clean up the tidb_ddl_reorg entry after DDL is completed

* Use a cleanup job afterwards instead.

* Fixed test

* Moved cleanup before asyncNotify

* More detailed test failure log

* Refined test error message

* Injecting timoeut to get stack traces from CI

* Updated Debug Dump on timeout

* Delete mulitple entries in tidb_ddl_reorg if needed

* Linting

* Linting

* Added CI debug logs

* Linting + CI debugs

* fixed CI debug

* Try to cleanup also if job.State == synced

* check for non-error of runErr instead of error...

* Use a new session, instead of reusing worker.sess

* Also handle case when job == nil

* Removed CI debug logs

* Misssed change session from w.sess to newly created sess

* Improved TestConcurrentDDLSwitch and added CI debug logs

* Always cleaning up all orphan mysql.tidb_ddl_reorg entries

* linting

* Also cleanup if job is nil

* Updated TestModifyColumnReorgInfo + CI debug logs

* more CI debug

* refactored the cleanupDDLReorgHandle code

* Added missing cleanup in handleDDLJobQueue

* Removed debug panic

* Code cleanup

* Test updates

* Debug cleanup

* Cleaned up test after removal of old non-concurrent DDL code merge

* Linting

* always wrap changes to tidb_ddl_reorg in an own transaction

+ fixed some typos

* Minimum fix

* Always update reorg meta, not only on error

* Issue is here :)

* Fixed newReorgHandler

* Wrapped more tidb_ddl_reorg changes into separate transactions

* linting

* Removed updateDDLReorgStartHandle

* cleanups

* Made runInTxn a method on *session, instead of normal function

* Update test

* Final touches

* Removed duplicate test

* CleanupDDLReorgHandles should only be called from HandleJobDone.

* Variable rename

* Renamed 'delete' variabel name

* Updated test

* small revert

* Removed timeout debugging code

* Simplified the cleanup to only start a new txn and not a new session

* Reverted the change of GetDDLInfo

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
2023-01-11 21:18:33 +08:00
2022-12-14 12:06:51 +08:00
2023-01-04 14:58:19 +08:00
2022-10-22 11:27:54 +08:00
2022-08-18 14:54:52 +08:00
2022-11-16 13:53:55 +08:00
2022-12-30 17:18:18 +08:00
2023-01-11 20:20:33 +08:00

TiDB, a distributed SQL database

LICENSE Language Build Status Go Report Card GitHub release GitHub release date Coverage Status GoDoc

What is TiDB?

TiDB (/’taɪdiːbi:/, "Ti" stands for Titanium) is an open-source distributed SQL database that supports Hybrid Transactional and Analytical Processing (HTAP) workloads. It is MySQL compatible and features horizontal scalability, strong consistency, and high availability.

For more details and latest updates, see TiDB documentation and release notes.

For future plans, see the TiDB roadmap.

Quick start

Start with TiDB Cloud

TiDB Cloud is the fully-managed service of TiDB, currently available on AWS and GCP.

Quickly check out TiDB Cloud with a free trial.

See TiDB Cloud Quick Start Guide.

Start with TiDB

See TiDB Quick Start Guide.

Start developing TiDB

See the Get Started chapter of TiDB Development Guide.

Community

You can join the following groups or channels to discuss or ask questions about TiDB, and to keep yourself informed of the latest TiDB updates:

For support, please contact PingCAP.

Contributing

The community repository hosts all information about the TiDB community, including how to contribute to TiDB, how the TiDB community is governed, how teams are organized.

Contributions are welcomed and greatly appreciated. You can get started with one of the good first issues or help wanted issues. For more details on typical contribution workflows, see Contribute to TiDB. For more contributing information about where to start, click the contributor icon below.

contribution-map

Every contributor is welcome to claim your contribution swag by filling in and submitting this form.

Case studies

Architecture

TiDB architecture

License

TiDB is under the Apache 2.0 license. See the LICENSE file for details.

Acknowledgments

Description
No description provided
Readme Apache-2.0 568 MiB
Languages
Go 95%
Starlark 2.5%
Shell 1.4%
Yacc 0.7%
Jsonnet 0.2%