Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: merge feature/reorganize-partition into reorg-part-rollback (part 3) dec30 #40264

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
813 commits
Select commit Hold shift + click to select a range
3e9c95b
Updated comments
mjonss Dec 6, 2022
be09b67
domain: save action type directly instead of left shift it (#39660)
Defined2014 Dec 7, 2022
032e6fd
br: fix getting region failure with other s3 compatible storage (#39653)
WangLe1321 Dec 7, 2022
442c044
sessionctx: add TiDBDDLEnableDistributeReorg flag (#39663)
Defined2014 Dec 7, 2022
b33ff62
*: enable tidb_enable_foreign_key variable default (#39677)
crazycs520 Dec 7, 2022
a0a16d7
domain: support plan replayer dump workers running in concurrency (#3…
Yisaer Dec 7, 2022
26bbb71
lightning: fix integration test (#39697)
dsdashun Dec 7, 2022
d7d059c
br/streamhelper: added timeout for ticking (#39625)
YuJuncen Dec 7, 2022
2ea253e
ddl: handle ErrNotOwner properly for modify column (#39645)
zimulala Dec 7, 2022
8e742bf
bootstrap: increase current bootstrap version and fix comment (#39700)
YangKeao Dec 7, 2022
a743640
*: enable foreign_key_checks variable by default (#39695)
crazycs520 Dec 7, 2022
05d4256
util: add EMA cpu monitor (#39526)
hawkingrei Dec 7, 2022
770e75b
session: fix data race in TestBootstrap (#39718)
wshwsh12 Dec 7, 2022
edabc32
br: fix integration test cases with `--with-sys-table` (#39655)
MoCuishle28 Dec 7, 2022
8e3cbac
*: bind user to some resource group (#39561)
BornChanger Dec 7, 2022
b6098ef
ddl: assign table record prefix to start/end key if it is empty (#39683)
tangenta Dec 7, 2022
f99fe0b
Removed comment, since assertions are already handled.
mjonss Dec 7, 2022
1c77888
stmtsummary: fix data race in the stmtSummaryByDigestElement.authUser…
hawkingrei Dec 7, 2022
6924a44
*: fix panic when add index on prefixed pk tables (#39740)
tangenta Dec 7, 2022
98d84ab
br/streamhelper: fix subscribe error (#39689)
YuJuncen Dec 7, 2022
d9af2d1
Revert "planner: update the cost formula of IndexJoin+IndexLookup" (#…
qw4990 Dec 7, 2022
4ce3386
planner: fix data race in the TestLongBinaryPlan (#39747)
hawkingrei Dec 8, 2022
5348bb3
oomtest: add filter to avoid flaky test in the oomCapture (#39728)
hawkingrei Dec 8, 2022
7134b7b
test: fix unstable test TestStaleReadProcessorWithSelectTable (#37858)
YangKeao Dec 8, 2022
a8fff0f
txn: workaround memdb panic (#39741)
ekexium Dec 8, 2022
c65a93a
planner: check error when building INLJ executor (#39756)
qw4990 Dec 8, 2022
c21dc26
log-backup: set gc disable when restore log (#39729)
joccau Dec 8, 2022
8bb7049
Updated comment
mjonss Dec 8, 2022
168c2ab
ddl: Stabilise TestAlterModifyColumnOnPartitionedTableFail, due to #3…
mjonss Dec 8, 2022
4b98439
lightning: record network usage (#39673)
buchuitoudegou Dec 8, 2022
754e73a
variable: fix outdated time shift for variable with `TypeTime` (#39720)
YangKeao Dec 8, 2022
a974efc
Removed TODO after checking that DROP PARTITION also cleans up PD
mjonss Dec 8, 2022
6784bfd
sessionctx: move shardRand from TransactionContext to SessionVars to …
tiancaiamao Dec 8, 2022
631f32d
executor: support plan replayer capture <sql> <*> (#39754)
Yisaer Dec 8, 2022
4c04abc
*: support disaggregated tiflash (#33535)
guo-shaoge Dec 8, 2022
768493f
Fixed deletion of PD rule for TiFlash after Reorg Partition
mjonss Dec 8, 2022
2d2f4f5
ttl: add methods to split ttl scan tasks (#39627)
lcwangchao Dec 8, 2022
2a928d8
ddl: unregister add index job after DDL done (#39769)
tangenta Dec 8, 2022
0e1eef3
log-backup: PITR do not support batch if skip requirement check (#39770)
joccau Dec 9, 2022
c19adff
executor: fix issue of execute prepared DML panic with foreign key ca…
crazycs520 Dec 9, 2022
f612724
*: close recordset (#39783)
hawkingrei Dec 9, 2022
96eb4ba
sessionctx/stmtctx: do not use copy-on-read for GetWarnings function …
tiancaiamao Dec 9, 2022
9283650
lightning: update to new TLS API of SQL driver (#39623)
lance6716 Dec 9, 2022
f18be89
br: add retry for azblob read file (#39650)
Leavrth Dec 9, 2022
f681af5
copr: fix data race in the mppIterator (#39772)
hawkingrei Dec 9, 2022
d176b38
testkit: set GOMAXPROCS in test (#39766)
hawkingrei Dec 9, 2022
ef6fb2e
statistics: support download history stats from stats_history (#39701)
Yisaer Dec 9, 2022
59cda14
*: Support Failed-Login Tracking and Temporary Account Locking (#39322)
lastincisor Dec 9, 2022
1ff1342
ddl: mark the writes from delete-only and drop them on merge (#39796)
tangenta Dec 10, 2022
86fc600
fix: update ioutil func&pruning case (#39798)
songzhibin97 Dec 10, 2022
3884b28
dumpling: meter network usage (#39774)
buchuitoudegou Dec 10, 2022
ee5d8cc
staleread: fix flaky test TestStaleReadProcessorWithExecutePreparedSt…
hawkingrei Dec 12, 2022
c13dfe3
domain: fix data race in the MockInfoCacheAndLoadInfoSchema (#39802)
hawkingrei Dec 12, 2022
4731204
*: upgrade rules_go (#39797)
hawkingrei Dec 12, 2022
9488ca9
*: Add backfill job related tables and operations (#39616)
zimulala Dec 12, 2022
965ed00
ttl: implement ttl job schedule framework (#39472)
YangKeao Dec 12, 2022
c8b5c3b
*: stable tiflash test in ddl (#39825)
hawkingrei Dec 12, 2022
fa792b3
planner: fix index prefix matching (#39377)
dveeden Dec 12, 2022
3183582
parser: add cast to array and member of support (#39820)
xiongjiwei Dec 12, 2022
33e5baa
fix: update ioutil.readall (#39850)
songzhibin97 Dec 13, 2022
3f86a11
planner: add three fields to statement summary table (#39828)
fzzf678 Dec 13, 2022
b73eb4b
ddl: fix unexpect fail when create expression index (#39822)
Defined2014 Dec 13, 2022
c332979
ttl: ouput TTL comment format when show create table (#39853)
lcwangchao Dec 13, 2022
95cbc5f
dumpling: add enable paging for tidb server (#39791)
lichunzhu Dec 13, 2022
2dea8dd
planner: support explain format='cost_trace' on model ver2 (#39840)
qw4990 Dec 13, 2022
621115b
ttl, variables: add system variables for ttl job schedule (#39727)
YangKeao Dec 13, 2022
b7e21a0
*: fix slow query nil pointer panic when get session for TTL (#39865)
lcwangchao Dec 13, 2022
cb435fe
ttl: Add metrics for TTL (#39849)
lcwangchao Dec 13, 2022
760dbe1
statistics: support gc outdated historical stats (#39788)
Yisaer Dec 13, 2022
aeceb22
planner: rename `general plan cache` to `non-prepared plan cache` (#3…
qw4990 Dec 13, 2022
1ab88f2
planner: rename 'tidb_enable_general_plan_cache' and 'tidb_general_pl…
qw4990 Dec 13, 2022
509fe6d
planner: binding from cluster statements summary (#39737)
fzzf678 Dec 13, 2022
c4047cc
ttl: modify default value of `tidb_ttl_delete_batch_size` to 100 (#39…
lcwangchao Dec 13, 2022
90a7398
ddl: close lightning writers after the import is complete (#39879)
tangenta Dec 13, 2022
d0d6955
store/copr: handle region error from client (#39838)
you06 Dec 13, 2022
827d8ff
ttl: fix scan workers shrink (#39860)
YangKeao Dec 13, 2022
222faa4
docs: fix typos (#39870)
mamil Dec 13, 2022
4b3a442
domain: support dump sql meta in plan replayer (#39863)
Yisaer Dec 13, 2022
1e7c6dd
SlowLog: Update `Wait_TS` field in slow log for every sql (#39843)
TonsnakeLin Dec 13, 2022
98cef5a
session: fix a bug for InitDDLJobTables (#39861)
zimulala Dec 13, 2022
d2eca72
ttl: reschedule scan tasks after update task state (#39891)
YangKeao Dec 13, 2022
0426cda
Merge remote-tracking branch 'pingcap/feature/reorganize-partition' i…
mjonss Dec 13, 2022
4a19cae
ttl: TTL support split scan ranges for some primary key with more tha…
lcwangchao Dec 14, 2022
ba5e85b
*: add dependabot (#39229)
hawkingrei Dec 14, 2022
b41be06
expression: support `json_overlaps` function (#39867)
xiongjiwei Dec 14, 2022
1e7c552
executor, planner: `InitLogger` before `CreateMockStore` in tests to …
time-and-fate Dec 14, 2022
388e008
statistics: add source column for stats_meta_hisotry table (#39835)
Yisaer Dec 14, 2022
66a2e96
ttl: fix ttl txn will not return error when rolling back (#39918)
lcwangchao Dec 14, 2022
565128e
expression: close recordset (#39899)
hawkingrei Dec 14, 2022
dd42b72
br: make more sane variables of ticking timeout (#39887)
YuJuncen Dec 14, 2022
bb50e33
expression: support `member of` function (#39880)
xiongjiwei Dec 14, 2022
e5c0b6b
br: fix err overwrite (#39935)
Leavrth Dec 14, 2022
aeec193
ttl: add log in the whole lifecycle of a job (#39931)
YangKeao Dec 14, 2022
de865c4
ttl: use optimistic transaction with 0 retry limit for ttl (#39924)
YangKeao Dec 14, 2022
4ad530e
ttl: periodically update state for a job in heartbeat (#39939)
YangKeao Dec 14, 2022
62a8001
parser: support syntax set binding status by sql digest (#39515)
fzzf678 Dec 14, 2022
c26a6b5
*: lock row keys during merging back from temp index (#39936)
tangenta Dec 14, 2022
d8d260e
Merge remote-tracking branch 'pingcap/feature/reorganize-partition' i…
mjonss Dec 14, 2022
47c0c0c
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 14, 2022
1dd12ec
Merge branch 'reorg-partition-double-write' into reorg-part-rollback
mjonss Dec 14, 2022
caed970
ci debugging
mjonss Dec 14, 2022
51f0658
ttl: initialize notifyStateCh in ttl job manager (#39956)
YangKeao Dec 15, 2022
0f95a5a
domain, statistics: periodically update stats healthy distribution (#…
xuyifangreeneyes Dec 15, 2022
acb8d46
ttl: enable 1pc for ttl delete (#39958)
lcwangchao Dec 15, 2022
8a539c1
docs/design: format the name of 'Adding-Index-Acceleration' RFC. (#39…
bb7133 Dec 15, 2022
79b4e63
*: fix auto analyze worker crash when killed by global memory limit (…
chrysan Dec 15, 2022
3760815
doc: add a proposal for foreign key (#35982)
crazycs520 Dec 15, 2022
3aba336
domain: Support plan replayer continus capture (#39926)
Yisaer Dec 15, 2022
9d2c9ee
expression, json: fix cast json as string with shorter length (#39970)
YangKeao Dec 15, 2022
97a9e63
sessionctx, executor: fix failure of reading MaxPreparedStmtCount (#3…
xuyifangreeneyes Dec 15, 2022
53572f8
resourcemanger: create cpu monitor (#39962)
hawkingrei Dec 16, 2022
0fe61bd
*: prevent cursor read from being cancelled by GC (#39950)
zyguan Dec 16, 2022
ebbfb61
dumpling: supports foreign key limitations (#39914)
lichunzhu Dec 16, 2022
8629514
build(deps): bump golang.org/x/net from 0.2.0 to 0.4.0 (#39996)
dependabot[bot] Dec 16, 2022
c763eb9
planner: fix pessimistic-auto-commit not working for point plans (#39…
zyguan Dec 16, 2022
d2393e3
fix: ebs volume restore failure since incorrect unfinished volumes (#…
fengou1 Dec 16, 2022
3970cfc
planner, json: restore cast flag after substitute column in cast (#39…
YangKeao Dec 16, 2022
223a912
staleread, session: internal write request should be accepted with ex…
YangKeao Dec 17, 2022
f150d37
*: revert 38302, forbid modify column on partition table (#39991)
wjhuang2016 Dec 17, 2022
47f5460
executor: close recordset again (#40010)
hawkingrei Dec 19, 2022
48585a7
ddl: retry prepare RPC when meets region error (#39834)
Defined2014 Dec 19, 2022
08f6ea4
metrics: add EMA cpu usage (#39995)
hawkingrei Dec 19, 2022
3edde02
executor: fix unstable TestMaxPreparedStmtCount (#40024)
xuyifangreeneyes Dec 19, 2022
0c18082
*: support sample for compressed files for adjustment (#39680)
lichunzhu Dec 19, 2022
5a08acd
docs: fix 'enable_global_index' to 'enable-global-index' (#40009)
mychoxin Dec 20, 2022
ae58fa1
expression: introduce `cast(... as ... array)` in expression index (#…
xiongjiwei Dec 20, 2022
9f4dd80
planner: fix the issue that NonPrep Cache cannot work with Explain we…
qw4990 Dec 20, 2022
030c506
ddl: fix waiting for wrong schema version if TiDB server restart (#39…
wjhuang2016 Dec 20, 2022
4a72171
*: Fix issue 39999, used wrong column id list for checking partitions…
mjonss Dec 20, 2022
6ab3803
oomtest: add whitelist for oom test to fix flaky test (#40055)
hawkingrei Dec 20, 2022
017901d
*: extend skyline pruning diagnostic info and add extra warnings (#39…
time-and-fate Dec 20, 2022
0f3031e
ddl: add privilege check when alter table add foreign key (#40051)
crazycs520 Dec 20, 2022
5f1a739
planner: add more test cases for non-prep plan cache (#40060)
qw4990 Dec 20, 2022
806fcbf
sessionctx: disable gc aware memory track (#40019)
chrysan Dec 20, 2022
fdf335e
*: make auto-analyze killable by global memory limit (#39978)
chrysan Dec 20, 2022
5a60f7e
Linting
mjonss Dec 20, 2022
85257f3
Updated after make bazel_prepare
mjonss Dec 21, 2022
ae2d551
cpu: fix ticker to avoid close early (#40036)
hawkingrei Dec 21, 2022
a2fa187
build(deps): bump golang.org/x/time from 0.2.0 to 0.3.0 (#39912)
dependabot[bot] Dec 21, 2022
51cce45
ddl: use latest ts to read record for adding index (#40081)
tangenta Dec 21, 2022
2150c6b
executor: close recordset again (#40073)
hawkingrei Dec 21, 2022
785f515
planner: add more test cases for MPP hints (#39933)
Reminiscent Dec 21, 2022
08f23ef
planner: support set binding status by sql digest (#39517)
fzzf678 Dec 21, 2022
b4f500e
ddl: check the limitation when creating multi-valued index (#39818)
xiongjiwei Dec 21, 2022
13e2120
sysvar: allow modifying 'tidb_allow_remove_auto_inc' when SEM is ON (…
CbcWestwolf Dec 21, 2022
ad0c202
*: fix issue of multi-schema change with foreign key (#40042)
crazycs520 Dec 21, 2022
9e8a21c
planner: check the `ignore-plan-cache` hint in insert-stmt (#40080)
qw4990 Dec 21, 2022
fc3f04b
parser: support keep_order and no_keep_order hint (#39965)
Reminiscent Dec 21, 2022
47ace08
*: filter particularly errors when `truncateAsWarning` is true (#40078)
xiongjiwei Dec 21, 2022
273e7e8
Removed CI debug log
mjonss Dec 21, 2022
b086421
Cleaned PR to only have the core of the data copying parts
mjonss Dec 21, 2022
74fa4c4
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 21, 2022
b0c16cd
More cleanup of PR to only focus on reorg data copy
mjonss Dec 21, 2022
73dcf5a
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 21, 2022
0accdd8
Added check to avoid null-pointer dereferencing
mjonss Dec 21, 2022
8c914b0
Fixed nil session context
mjonss Dec 21, 2022
0678894
Cleanup
mjonss Dec 21, 2022
3a1adcd
Added Info logs for debugging in CI
mjonss Dec 21, 2022
f23a27a
more CI debug info logs + cleared a TODO
mjonss Dec 22, 2022
ecb7f50
Added one more CI debug line
mjonss Dec 22, 2022
4e43b14
metrics: add metrics for ema cpu metrics and GOGC (#40049)
hawkingrei Dec 22, 2022
0f4bd73
server: avoid reusing cached stmt ctx on cursor read (#40023)
zyguan Dec 22, 2022
aeccf77
*: optimize mpp probe (#39932)
hackersean Dec 22, 2022
985b5ec
Update ddl/partition.go
mjonss Dec 22, 2022
4adce4c
statistics: fix the sync load sql did'nt running internally (#40087)
Yisaer Dec 22, 2022
5fdd3bd
server: support download plan replayer continues capture file (#40085)
Yisaer Dec 22, 2022
5c04d78
*: support foreign key check/cascade when execute replace into statem…
crazycs520 Dec 22, 2022
bfd5e66
More cleanup of PR to only focus on reorg data copy
mjonss Dec 22, 2022
0b0c7ec
Removed checkReorgParition, it will be back in part 3.
mjonss Dec 22, 2022
b7e590c
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 22, 2022
1e0d902
Moved code to only run once instead of for every fetchRowColVal
mjonss Dec 22, 2022
60a956b
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 22, 2022
eb6fec9
Return directly on error instead of retrying workerCnt times
mjonss Dec 22, 2022
3438e00
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 22, 2022
1305687
ddl: fix issue of add foreign key too slow in big table (#40112)
crazycs520 Dec 22, 2022
251a69a
Merge remote-tracking branch 'pingcap/feature/reorganize-partition' i…
mjonss Dec 22, 2022
0a275d6
Merge branch 'reorg-part-merge-dec22' into reorg-part-data-reorg-merg…
mjonss Dec 22, 2022
2e5b311
Added reverted code needed for reorganize partition
mjonss Dec 22, 2022
53edd89
ddl: fix issue of partition table with foreign key and add more test …
crazycs520 Dec 23, 2022
18c71f4
parser: fix cast function restore (#40129)
xiongjiwei Dec 23, 2022
d2be278
ddl: set context correctly in the setDDLLabelForDiagnosis (#40090)
you06 Dec 23, 2022
0eab90d
Merge remote-tracking branch 'pingcap/feature/reorganize-partition' i…
mjonss Dec 23, 2022
14879a7
planner: move code of generating IndexMergePath to a separated file (…
qw4990 Dec 23, 2022
060f189
Merge remote-tracking branch 'pingcap/feature/reorganize-partition' i…
mjonss Dec 23, 2022
5632e4a
post merge fix, removed test
mjonss Dec 23, 2022
7c093a2
Merge branch 'reorg-part-data-reorg' into reorg-part-rollback
mjonss Dec 23, 2022
c27499e
Merge branch 'reorg-partition-double-write' into reorg-part-rollback
mjonss Dec 23, 2022
014159d
statistics: fix incorrect datetime value when loading stats (#40084)
xuyifangreeneyes Dec 23, 2022
c61ef1d
ttl: escape parameters for finish job sql (#40118)
YangKeao Dec 23, 2022
4702033
Merge fix
mjonss Dec 23, 2022
3112178
Merge branch 'reorg-partition-double-write' into reorg-part-rollback
mjonss Dec 23, 2022
dfd9dae
Removed applyTableUpdate from applyReorgPart + CI debug
mjonss Dec 23, 2022
a9c528c
Linting
mjonss Dec 23, 2022
c30a9ff
ddl: prohibit change name of partitioning column (#40147)
mjonss Dec 24, 2022
6ad990a
updateTable CI testing
mjonss Dec 24, 2022
658f9a6
More CI debugging
mjonss Dec 24, 2022
9d55834
Even more CI debugs...
mjonss Dec 25, 2022
40edc9e
More CI testing skipping oom tests
mjonss Dec 25, 2022
34c03ad
more CI debugging
mjonss Dec 25, 2022
bcf8ef1
Linting
mjonss Dec 25, 2022
ff8bd3c
more CI debug
mjonss Dec 25, 2022
1ace970
lightning: disable foreign key checks (#40032)
sleepymole Dec 26, 2022
388364d
br: recursive split batch create table when restore failure on batch …
fengou1 Dec 26, 2022
8a4b31a
store/copr: don't reset concurrency of analyze req to 2 (#40168)
xuyifangreeneyes Dec 26, 2022
3e2ca84
Removed cleaning of tidb_ddl_reorg when ddl is completed (CI testing)
mjonss Dec 26, 2022
2f6401a
build(deps): bump golang.org/x/oauth2 from 0.2.0 to 0.3.0 (#40140)
dependabot[bot] Dec 26, 2022
fc241b2
domain: revise plan replayer process log (#40126)
Yisaer Dec 26, 2022
f9d4a54
expression: impl cast as array function (#40076)
xiongjiwei Dec 26, 2022
fc714e2
session: fix tidb_enable_gc_aware_memory_track after upgrade (#40173)
chrysan Dec 26, 2022
79ab2b9
restore: Fix prealloc (#40176)
YuJuncen Dec 26, 2022
cf56bf9
More CI debug...
mjonss Dec 27, 2022
ab01065
metrics: remove Keep Alive OPM metric (#40142)
CbcWestwolf Dec 27, 2022
3c8f11d
util: fix data race in the cpu test (#40154)
hawkingrei Dec 27, 2022
20bb046
executor: move some test into writetest (#40097)
hawkingrei Dec 27, 2022
22261a0
More CI debug
mjonss Dec 27, 2022
a94cde3
planner: fix an unstable explain test case (#40199)
qw4990 Dec 27, 2022
83d275c
ddl: Refine the error message to compatible with MySQL when drop a pa…
jiyfhust Dec 27, 2022
afbef28
executor: TiFlash supports stale read (#40048)
Dec 27, 2022
32f9604
ddl: ignore internal http client goroutine in leak tests (#40190)
tangenta Dec 27, 2022
bddfc62
ddl: add more foreign key test case (#40052)
crazycs520 Dec 28, 2022
11f5c17
*: add support for -initialize-sql-file on first bootstrap (#35625)
morgo Dec 28, 2022
b268c65
*: fix PointGet will return an stale value when `tidb_enable_plan_rep…
lcwangchao Dec 28, 2022
f9af75f
planner: support converting `json_member_of` to IndexMerge to access …
qw4990 Dec 28, 2022
b196756
planner: record reasons when skipping Plan Cache (#40210)
qw4990 Dec 28, 2022
869b21d
session: Do not run telemetry loops when it's disabled in config (#40…
sunxiaoguang Dec 28, 2022
667bc4c
docs/design: REORGANIZE PARTITION design (#38246)
mjonss Dec 28, 2022
c8124a0
ddl: Disable RENAME COLUMN for partitioning columns | tidb-test=pr/20…
mjonss Dec 29, 2022
92a936e
dumpling: add foreign key e2e test (#40133)
crazycs520 Dec 29, 2022
cf34941
ttl: make the TTL compatible with dumpling, lightning and BR (#40216)
lcwangchao Dec 29, 2022
1a7b395
ttl, domain: setup a customized session pool with stats collector (#4…
YangKeao Dec 29, 2022
6dff69f
ddl: Support flashback cluster with ddl history (#40209)
Defined2014 Dec 29, 2022
875c002
lightning: add foreign key test (#40103)
crazycs520 Dec 29, 2022
b94042c
planner: refine planner code for disaggregated tiflash mode (#39813)
guo-shaoge Dec 29, 2022
ea29db5
docs: update tidb roadmap based on v6.5 (#40170)
ran-huang Dec 29, 2022
ffaf2ac
planner: remove the unnecessary skip-plan-cache flag in StmtCtx (#40235)
qw4990 Dec 30, 2022
25dd54f
ttl: fix change status sql argument (#40234)
YangKeao Dec 30, 2022
72f52f3
planner: update the plan cache strategy when expressions with paramet…
qw4990 Dec 30, 2022
0134d0b
go.mod: upgrade badger to 20221229114011 (#40236)
YangKeao Dec 30, 2022
d3b952a
executor: write multi-valued index (#40172)
xiongjiwei Dec 30, 2022
8e80e7c
expression: implement `unhex` function pushdown to tiflash (#39898)
b41sh Dec 30, 2022
b97f60d
planner: remove the unnecessary skip-plan-cache flag in StmtCtx (#40246)
qw4990 Dec 30, 2022
1b8a233
restore: set config value to default when failed to get config from t…
YuJuncen Dec 30, 2022
6131e3f
ddl: check default value again in updateColumnDefaultValue (#40230)
wjhuang2016 Dec 30, 2022
91adaaf
docs: update roadmap (#40244)
ran-huang Dec 30, 2022
f7de8be
*: remove the support of the old ddl framework (#39684)
wjhuang2016 Dec 30, 2022
94b65bd
Merge remote-tracking branch 'pingcap/master' into feature-reorganize…
mjonss Dec 30, 2022
7ef86c3
Post merge fixes
mjonss Dec 30, 2022
7e2fa6c
Merge branch 'feature-reorganize-partition-merge-dec30' into reorg-pa…
mjonss Dec 30, 2022
ca03f9c
Changes from tidb#38738 to fix tidb_ddl_reorg conflicts
mjonss Dec 31, 2022
9ac5dff
Removed debug logs
mjonss Dec 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 38 additions & 30 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ def go_deps():
name = "com_github_cespare_xxhash_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/cespare/xxhash/v2",
sum = "h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=",
version = "v2.1.2",
sum = "h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=",
version = "v2.2.0",
)
go_repository(
name = "com_github_charithe_durationcheck",
Expand Down Expand Up @@ -1143,8 +1143,8 @@ def go_deps():
name = "com_github_go_kit_log",
build_file_proto_mode = "disable_global",
importpath = "github.com/go-kit/log",
sum = "h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw=",
version = "v0.2.0",
sum = "h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=",
version = "v0.2.1",
)
go_repository(
name = "com_github_go_logfmt_logfmt",
Expand Down Expand Up @@ -2182,8 +2182,8 @@ def go_deps():
name = "com_github_klauspost_compress",
build_file_proto_mode = "disable_global",
importpath = "github.com/klauspost/compress",
sum = "h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A=",
version = "v1.15.1",
sum = "h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0=",
version = "v1.15.13",
)
go_repository(
name = "com_github_klauspost_cpuid",
Expand Down Expand Up @@ -2435,8 +2435,8 @@ def go_deps():
name = "com_github_matttproud_golang_protobuf_extensions",
build_file_proto_mode = "disable_global",
importpath = "github.com/matttproud/golang_protobuf_extensions",
sum = "h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=",
version = "v1.0.1",
sum = "h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=",
version = "v1.0.4",
)
go_repository(
name = "com_github_maxatome_go_testdeep",
Expand Down Expand Up @@ -2881,8 +2881,8 @@ def go_deps():
name = "com_github_pingcap_badger",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/badger",
sum = "h1:MKVFZuqFvAMiDtv3AbihOQ6rY5IE8LWflI1BuZ/hF0Y=",
version = "v1.5.1-0.20220314162537-ab58fbf40580",
sum = "h1:QB16qn8wx5X4SRn3/5axrjPMNS3WRt87+5Bfrnmt6IA=",
version = "v1.5.1-0.20221229114011-ddffaa0fff7a",
)
go_repository(
name = "com_github_pingcap_check",
Expand All @@ -2895,8 +2895,8 @@ def go_deps():
name = "com_github_pingcap_errors",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/errors",
sum = "h1:3Dm0DWeQlwV8LbpQxP2tojHhxd9aY59KI+QN0ns6bBo=",
version = "v0.11.5-0.20220729040631-518f63d66278",
sum = "h1:m5ZsBa5o/0CkzZXfXLaThzKuR85SnHHetqBCpzQ30h8=",
version = "v0.11.5-0.20221009092201-b66cddb77c32",
)
go_repository(
name = "com_github_pingcap_failpoint",
Expand All @@ -2923,8 +2923,8 @@ def go_deps():
name = "com_github_pingcap_kvproto",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/kvproto",
sum = "h1:46ZD6xzQWJ8Jkeal/U7SqkX030Mgs8DAn6QV/9zbqOQ=",
version = "v0.0.0-20221130022225-6c56ac56fe5f",
sum = "h1:v0Z0nC0knwWHn3e9br8EMNfLBB14QDULn142UGjiTMQ=",
version = "v0.0.0-20221213093948-9ccc6beaf0aa",
)
go_repository(
name = "com_github_pingcap_log",
Expand Down Expand Up @@ -3001,29 +3001,29 @@ def go_deps():
name = "com_github_prometheus_client_golang",
build_file_proto_mode = "disable_global",
importpath = "github.com/prometheus/client_golang",
sum = "h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU=",
version = "v1.13.0",
sum = "h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=",
version = "v1.14.0",
)
go_repository(
name = "com_github_prometheus_client_model",
build_file_proto_mode = "disable_global",
importpath = "github.com/prometheus/client_model",
sum = "h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=",
version = "v0.2.0",
sum = "h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=",
version = "v0.3.0",
)
go_repository(
name = "com_github_prometheus_common",
build_file_proto_mode = "disable_global",
importpath = "github.com/prometheus/common",
sum = "h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=",
version = "v0.37.0",
sum = "h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI=",
version = "v0.39.0",
)
go_repository(
name = "com_github_prometheus_procfs",
build_file_proto_mode = "disable_global",
importpath = "github.com/prometheus/procfs",
sum = "h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=",
version = "v0.8.0",
sum = "h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=",
version = "v0.9.0",
)
go_repository(
name = "com_github_prometheus_prometheus",
Expand Down Expand Up @@ -3523,12 +3523,20 @@ def go_deps():
sum = "h1:mbAskLJ0oJfDRtkanvQPiooDH8HvJ2FBh+iKT/OmiQQ=",
version = "v0.0.0-20181126055449-889f96f722a2",
)
go_repository(
name = "com_github_tiancaiamao_gp",
build_file_proto_mode = "disable",
importpath = "github.com/tiancaiamao/gp",
sum = "h1:4RNtqw1/tW67qP9fFgfQpTVd7DrfkaAWu4vsC18QmBo=",
version = "v0.0.0-20221221095600-1a473d1f9b4b",
)

go_repository(
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sum = "h1:/glZOHs/K2pkCioDVae+aThUHFYRYQkEgY4NUTgfh+s=",
version = "v2.0.3",
sum = "h1:m6glgBGCIds9QURbk8Mn+8mjLKDcv6nWrNwYh92fydQ=",
version = "v2.0.4-0.20221226080148-018c59dbd837",
)
go_repository(
name = "com_github_tikv_pd_client",
Expand Down Expand Up @@ -4432,8 +4440,8 @@ def go_deps():
name = "org_golang_x_oauth2",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/oauth2",
sum = "h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU=",
version = "v0.2.0",
sum = "h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8=",
version = "v0.3.0",
)
go_repository(
name = "org_golang_x_sync",
Expand Down Expand Up @@ -4600,8 +4608,8 @@ def go_deps():
name = "org_uber_go_multierr",
build_file_proto_mode = "disable_global",
importpath = "go.uber.org/multierr",
sum = "h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=",
version = "v1.8.0",
sum = "h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=",
version = "v1.9.0",
)
go_repository(
name = "org_uber_go_tools",
Expand All @@ -4614,6 +4622,6 @@ def go_deps():
name = "org_uber_go_zap",
build_file_proto_mode = "disable_global",
importpath = "go.uber.org/zap",
sum = "h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY=",
version = "v1.23.0",
sum = "h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=",
version = "v1.24.0",
)
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ bazel_coverage_test: failpoint-enable bazel_ci_prepare
--build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \
--build_event_json_file=bazel_2.json --@io_bazel_rules_go//go/config:cover_format=go_cover --define gotags=featuretag \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...

bazel_build: bazel_ci_prepare
mkdir -p bin
Expand Down
9 changes: 5 additions & 4 deletions br/pkg/conn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ func NewMgr(
return nil, errors.Trace(err)
}
// we must check tidb(tikv version) any time after concurrent ddl feature implemented in v6.2.
// when tidb < 6.2 we need set EnableConcurrentDDL false to make ddl works.
// we will keep this check until 7.0, which allow the breaking changes.
// NOTE: must call it after domain created!
// FIXME: remove this check in v7.0
Expand Down Expand Up @@ -281,7 +280,8 @@ func (mgr *Mgr) GetTS(ctx context.Context) (uint64, error) {
}

// GetMergeRegionSizeAndCount returns the tikv config `coprocessor.region-split-size` and `coprocessor.region-split-key`.
func (mgr *Mgr) GetMergeRegionSizeAndCount(ctx context.Context, client *http.Client) (uint64, uint64, error) {
// returns the default config when failed.
func (mgr *Mgr) GetMergeRegionSizeAndCount(ctx context.Context, client *http.Client) (uint64, uint64) {
regionSplitSize := DefaultMergeRegionSizeBytes
regionSplitKeys := DefaultMergeRegionKeyCount
type coprocessor struct {
Expand Down Expand Up @@ -310,9 +310,10 @@ func (mgr *Mgr) GetMergeRegionSizeAndCount(ctx context.Context, client *http.Cli
return nil
})
if err != nil {
return 0, 0, errors.Trace(err)
log.Warn("meet error when getting config from TiKV; using default", logutil.ShortError(err))
return DefaultMergeRegionSizeBytes, DefaultMergeRegionKeyCount
}
return regionSplitSize, regionSplitKeys, nil
return regionSplitSize, regionSplitKeys
}

// GetConfigFromTiKV get configs from all alive tikv stores.
Expand Down
35 changes: 33 additions & 2 deletions br/pkg/conn/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,38 @@ func TestGetMergeRegionSizeAndCount(t *testing.T) {
regionSplitSize: DefaultMergeRegionSizeBytes,
regionSplitKeys: DefaultMergeRegionKeyCount,
},
{
stores: []*metapb.Store{
{
Id: 1,
State: metapb.StoreState_Up,
Labels: []*metapb.StoreLabel{
{
Key: "engine",
Value: "tiflash",
},
},
},
{
Id: 2,
State: metapb.StoreState_Up,
Labels: []*metapb.StoreLabel{
{
Key: "engine",
Value: "tikv",
},
},
},
},
content: []string{
"",
// Assuming the TiKV has failed due to some reason.
"",
},
// no tikv detected in this case
regionSplitSize: DefaultMergeRegionSizeBytes,
regionSplitKeys: DefaultMergeRegionKeyCount,
},
{
stores: []*metapb.Store{
{
Expand Down Expand Up @@ -388,8 +420,7 @@ func TestGetMergeRegionSizeAndCount(t *testing.T) {
httpCli := mockServer.Client()
mgr := &Mgr{PdController: &pdutil.PdController{}}
mgr.PdController.SetPDClient(pdCli)
rs, rk, err := mgr.GetMergeRegionSizeAndCount(ctx, httpCli)
require.NoError(t, err)
rs, rk := mgr.GetMergeRegionSizeAndCount(ctx, httpCli)
require.Equal(t, ca.regionSplitSize, rs)
require.Equal(t, ca.regionSplitKeys, rk)
mockServer.Close()
Expand Down
28 changes: 25 additions & 3 deletions br/pkg/gluetidb/glue.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,32 @@ func (gs *tidbSession) CreatePlacementPolicy(ctx context.Context, policy *model.
return d.CreatePlacementPolicyWithInfo(gs.se, policy, ddl.OnExistIgnore)
}

// SplitBatchCreateTable provide a way to split batch into small batch when batch size is large than 6 MB.
// The raft entry has limit size of 6 MB, a batch of CreateTables may hit this limitation
// TODO: shall query string be set for each split batch create, it looks does not matter if we set once for all.
func (gs *tidbSession) SplitBatchCreateTable(schema model.CIStr, info []*model.TableInfo, cs ...ddl.CreateTableWithInfoConfigurier) error {
var err error
d := domain.GetDomain(gs.se).DDL()
if err = d.BatchCreateTableWithInfo(gs.se, schema, info, append(cs, ddl.OnExistIgnore)...); kv.ErrEntryTooLarge.Equal(err) {
if len(info) == 1 {
return err
}
mid := len(info) / 2
err = gs.SplitBatchCreateTable(schema, info[:mid])
if err != nil {
return err
}
err = gs.SplitBatchCreateTable(schema, info[mid:])
if err != nil {
return err
}
return nil
}
return err
}

// CreateTables implements glue.BatchCreateTableSession.
func (gs *tidbSession) CreateTables(ctx context.Context, tables map[string][]*model.TableInfo, cs ...ddl.CreateTableWithInfoConfigurier) error {
d := domain.GetDomain(gs.se).DDL()
var dbName model.CIStr

// Disable foreign key check when batch create tables.
Expand Down Expand Up @@ -233,8 +256,7 @@ func (gs *tidbSession) CreateTables(ctx context.Context, tables map[string][]*mo
cloneTables = append(cloneTables, table)
}
gs.se.SetValue(sessionctx.QueryString, queryBuilder.String())
err := d.BatchCreateTableWithInfo(gs.se, dbName, cloneTables, append(cs, ddl.OnExistIgnore)...)
if err != nil {
if err := gs.SplitBatchCreateTable(dbName, cloneTables); err != nil {
//It is possible to failure when TiDB does not support model.ActionCreateTables.
//In this circumstance, BatchCreateTableWithInfo returns errno.ErrInvalidDDLJob,
//we fall back to old way that creating table one by one
Expand Down
50 changes: 7 additions & 43 deletions br/pkg/lightning/restore/tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ func DBFromConfig(ctx context.Context, dsn config.DBStore) (*sql.DB, error) {
"tidb_opt_write_row_id": "1",
// always set auto-commit to ON
"autocommit": "1",
// alway set transaction mode to optimistic
// always set transaction mode to optimistic
"tidb_txn_mode": "optimistic",
// disable foreign key checks
"foreign_key_checks": "0",
}

if dsn.Vars != nil {
Expand Down Expand Up @@ -143,62 +145,24 @@ func (timgr *TiDBManager) Close() {
timgr.db.Close()
}

func InitSchema(ctx context.Context, g glue.Glue, database string, tablesSchema map[string]string) error {
logger := log.FromContext(ctx).With(zap.String("db", database))
sqlExecutor := g.GetSQLExecutor()

var createDatabase strings.Builder
createDatabase.WriteString("CREATE DATABASE IF NOT EXISTS ")
common.WriteMySQLIdentifier(&createDatabase, database)
err := sqlExecutor.ExecuteWithLog(ctx, createDatabase.String(), "create database", logger)
if err != nil {
return errors.Trace(err)
}

task := logger.Begin(zap.InfoLevel, "create tables")
var sqlCreateStmts []string
loopCreate:
for tbl, sqlCreateTable := range tablesSchema {
task.Debug("create table", zap.String("schema", sqlCreateTable))

sqlCreateStmts, err = createIfNotExistsStmt(g.GetParser(), sqlCreateTable, database, tbl)
if err != nil {
break
}

// TODO: maybe we should put these createStems into a transaction
for _, s := range sqlCreateStmts {
err = sqlExecutor.ExecuteWithLog(
ctx,
s,
"create table",
logger.With(zap.String("table", common.UniqueTable(database, tbl))),
)
if err != nil {
break loopCreate
}
}
}
task.End(zap.ErrorLevel, err)

return errors.Trace(err)
}

func createIfNotExistsStmt(p *parser.Parser, createTable, dbName, tblName string) ([]string, error) {
stmts, _, err := p.ParseSQL(createTable)
if err != nil {
return []string{}, common.ErrInvalidSchemaStmt.Wrap(err).GenWithStackByArgs(createTable)
}

var res strings.Builder
ctx := format.NewRestoreCtx(format.DefaultRestoreFlags|format.RestoreTiDBSpecialComment, &res)
ctx := format.NewRestoreCtx(format.DefaultRestoreFlags|format.RestoreTiDBSpecialComment|format.RestoreWithTTLEnableOff, &res)

retStmts := make([]string, 0, len(stmts))
for _, stmt := range stmts {
switch node := stmt.(type) {
case *ast.CreateDatabaseStmt:
node.Name = model.NewCIStr(dbName)
node.IfNotExists = true
case *ast.DropDatabaseStmt:
node.Name = model.NewCIStr(dbName)
node.IfExists = true
case *ast.CreateTableStmt:
node.Table.Schema = model.NewCIStr(dbName)
node.Table.Name = model.NewCIStr(tblName)
Expand Down
Loading