Commit Graph

16 Commits

Author SHA1 Message Date
e939c9b283 ddl: fix return duplicate schema version during multi-schema change (#39093)
close pingcap/tidb#39090
2022-11-14 13:29:54 +08:00
ab513bf0ca ddl: support concurrent ddl (#32169)
* 1. init ddl tables

create tidb_ddl_job, tidb_ddl_reorg, tidb_ddl_history tables with raw meta write, these 3 tables is use to replace the ddl job queue and reorg and history hash table

* 2. setup concurrent ddl env and add ddl worker pool

adds the ddl worker pool definition, the ddl job manager will find a job and ship it to a worker in the worker pool.
Also, this commit provides a sessionctx wrapper, only use in ddl relate. it just wraps begin, commit and execute

* 3. add ddl manager to handle ddl job

* 4. reorg handler for concurrent ddl

just implements the partner of the reorg information.

* 5. manage ddl jobs for concurrent ddl

add the partner of add job, delete job and many others related to history job
because many of the functions need a session now, we just change the caller

* 6. add metrics for concurrent ddl

add metrics

* 7. support multiple tables

* 8. fix test

* 9. migrate ddl between table and queue

support switch between the old and new ddl framework, migrate the existing ddl job between queue and table

* 10. check tikv version and set reorg worker count according cpu count

* *: add featuretag on tests

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>

* use a determined table id for 3 tables

* remove ctx value

* add GetSchemaVersionWithNonEmptyDiff function

* address tangenta and zimulala comment

* use only one etcd path

* make ActionRenameTable support multi-schema

* reset sql digest to make top sql work correct

* add comment

* fix test

* remove 0 for schema version lock

Co-authored-by: xiongjiwei <xiongjiwei1996@outlook.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: wjHuang <huangwenjun1997@gmail.com>
2022-07-20 21:20:07 +08:00
911e7cc360 *: enable revive (#35970)
ref pingcap/tidb#35345
2022-07-15 16:03:06 +08:00
xhe
94e30df8e2 parser: fix compiling, add unit tests (#28700) 2021-10-11 23:15:25 +08:00
7755d25aba *: Integrate SkyWalking-eyes to check license headers in CI and fix licenses headers (#27198) 2021-08-16 18:52:00 +08:00
a6bde1e4ef ddl: add http api to set customized ddl hook for remote ticase test (#24198) 2021-04-27 14:57:56 +08:00
be29d7e054 ddl: fix db_test failure caused by domain reload delay under a high overload (#21928)
Signed-off-by: AilinKid <314806019@qq.com>
2020-12-24 15:43:30 +08:00
c137cada68 *: change golang.org/x/net/context to standard context (#8579) 2018-12-05 13:54:00 +08:00
89dda9d9a8 *: move parser to a separate repository (#8036) 2018-10-25 11:12:10 +08:00
e28a81813c *: check the schema-validity when the DDL fails (#6797) 2018-07-09 17:35:04 +08:00
e1121814d2 *: don't import golang.org/x/net/context as goctx alias (#5895)
Now that there is no conflict with sessionctx.Context, this can be
import directly
2018-02-24 03:40:56 -06:00
1eebb87156 ddl: remove backgroud worker, use delete-range to speed up something. (#3993) 2017-08-09 16:59:25 +08:00
ff18bbf871 ddl: Use etcd to elect the owner (#3158) 2017-05-18 01:31:52 +08:00
5df5085e33 *: Add row count field in a job, fix a drop schema bug and pass race (#1759) 2016-09-28 18:11:40 +08:00
85126b0942 ddl: OnJobRunAfter -> OnJobUpdated 2015-11-10 09:34:43 +08:00
efaeeff945 *: add ddl callback interface
we can customize the callback for better test.
2015-11-09 17:38:07 +08:00