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 master into feature/reorganize-partition dec22 #40117

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
621 commits
Select commit Hold shift + click to select a range
9689b47
ddl: improve log messages (#39376)
hawkingrei Nov 29, 2022
1b15732
telemetry: add telemetry for alter table compact partition (#39452)
Nov 29, 2022
8a5ccd8
planner: support the view hint(part-2) (#39280)
Reminiscent Nov 29, 2022
19dae1f
*: separate auto_increment ID allocator from _tidb_rowid allocator wh…
tiancaiamao Nov 29, 2022
23543a4
*: merge the runtime stats in time to avoid using too many memory (#3…
wshwsh12 Nov 29, 2022
d2ace99
br: leader selection with tikv store balance score during the ebs dat…
fengou1 Nov 29, 2022
2c0c130
session: workaround for upgrade from the old master version (#39451)
wjhuang2016 Nov 29, 2022
1cebd1d
*: improve `flashback to timestamp`, let it compatible with TiCDC (#3…
Defined2014 Nov 29, 2022
e135608
executor: support Intersection of IndexMerge (#38636)
guo-shaoge Nov 29, 2022
c88fd23
planner: add sqlDigest and planDigest field when show bindings (#39156)
fzzf678 Nov 29, 2022
4476173
planner: update cost model2 (#39438)
qw4990 Nov 29, 2022
cca78e3
planner: forbid point get with select lock choose tiflash as datasour…
Yisaer Nov 29, 2022
6241d60
planner, executor: support intersection type IndexMerge with hint in …
time-and-fate Nov 30, 2022
06072d6
Explain: change the explain analyze output info (#39444)
hongyunyan Nov 30, 2022
e98e959
*: add telemetry support for IndexMerge (#39469)
guo-shaoge Nov 30, 2022
1de2bf6
Backup: add checkpoint (#38648)
Leavrth Nov 30, 2022
328aef8
lightning: add precheck about downstream CDC/PiTR (#39338)
lance6716 Nov 30, 2022
40f0bd5
executor: add index_merge_intersection cases (#39323)
guo-shaoge Nov 30, 2022
a48fe79
executor: close resultset (#39474)
hawkingrei Nov 30, 2022
a00f0fe
autoid_service,meta/autoid: distinguish retriable error from non-retr…
tiancaiamao Nov 30, 2022
31d943f
Design: add the design doc for view hint (#39313)
Reminiscent Nov 30, 2022
8e4748a
*: make auto-analyze concurrency configurable (#37078)
chrysan Nov 30, 2022
f5487e3
br: add foreign key test for br (#39427)
crazycs520 Nov 30, 2022
f06fb5a
util, executor: refine the memory usage of delete multiple tables (#3…
XuHuaiyu Nov 30, 2022
63ce793
*: add foreign key check/cascade runtime stats information in explain…
crazycs520 Nov 30, 2022
d20d71f
ddl: don't delay for async commit if MDL is enabled (#39446)
wjhuang2016 Nov 30, 2022
adcacd8
planner: support drop binding by sql digest (#39399)
fzzf678 Nov 30, 2022
8b06ef2
planner: enable cost model2 by default (#39487)
qw4990 Nov 30, 2022
30a8414
ddl: gc mdl etcd key after cleaning the mdl table (#39454)
wjhuang2016 Nov 30, 2022
fa7cf31
*: fix goleak in the statisticstest (#39503)
hawkingrei Nov 30, 2022
dea207b
executor: fix index merge intersection may stuck (#39495)
guo-shaoge Dec 1, 2022
04b676a
distsql_test: fix TestPartitionTableIndexLookUpReader (#39522)
Defined2014 Dec 1, 2022
8e0e49c
*: support JSON format output in explain statement (#39253)
fzzf678 Dec 1, 2022
7add1c8
ttl: refractor ttl pkg into multiple sub packages (#39491)
YangKeao Dec 1, 2022
1f04e14
domain: support dump historical stats in background job (#39417)
Yisaer Dec 1, 2022
8bbf75d
br: Fix overlapped ranges (#39496)
YuJuncen Dec 1, 2022
d1fc5b6
expression: implement `regexp_instr` function pushdown (#39479)
xzhangxian1008 Dec 1, 2022
d3f7ec0
br: skip compatibility check for the mysql.user table when restoring …
MoCuishle28 Dec 1, 2022
09d1a81
bazel: mirror java_tools (#39509)
hawkingrei Dec 1, 2022
78011c5
lightning: add WithDupIndicator to expose status to caller (#39461)
lance6716 Dec 1, 2022
a6eba9b
txn: fix alias related bugs for non-transactional DML (#39459)
ekexium Dec 1, 2022
213187c
server: use advertise addr for autoid service to expose itself (#39497)
tiancaiamao Dec 1, 2022
c3565a1
planner: set cost model to ver1 for clusters upgrading from pre-6.1 v…
qw4990 Dec 1, 2022
6a4b909
parser: add global variable to control ttl syntax (#39483)
YangKeao Dec 1, 2022
e307642
ddl: reuse chunk for copr-read and check context done (#39473)
tangenta Dec 1, 2022
202f723
planner: support create binding from history (#39436)
fzzf678 Dec 1, 2022
9f98f47
restore: Adapt the protocol of caching storage (#39541)
YuJuncen Dec 1, 2022
c8fdfbc
server: fix port of autoid_service (#39552)
tiancaiamao Dec 1, 2022
d354d8d
executor: fix data race on the IndexMergeReaderExecutor (#39513)
hawkingrei Dec 1, 2022
4b1bb5b
log-backup: implement subscription of flush (#39445)
YuJuncen Dec 1, 2022
dcec972
sessionctx: set default val of EnableOuterJoinReorder to true (#39505)
winoros Dec 1, 2022
94ffc8e
error: print non-printable chars in hex style for duplicate entry err…
winkyao Dec 1, 2022
9d9eaca
store/copr: support batch coprocessor requests by store (#39525)
you06 Dec 1, 2022
9eea8f6
expression: implement `regexp_substr` function pushdown (#39536)
xzhangxian1008 Dec 1, 2022
89e9078
planner: fix panic when upgrade from 4.0.16 to master (#39538)
fzzf678 Dec 1, 2022
9a7341e
executor: add tests for property pushed down for partition table (#39…
winoros Dec 1, 2022
7b91e6a
planner: enrich diagnosis info for plan-cache (#39457)
qw4990 Dec 1, 2022
3bb8e79
executor: add globalAnalyzeTracker back (#39500)
XuHuaiyu Dec 1, 2022
12e5272
statistics: enlarge capacity of ddlEventCh to 1000 (#39532)
xuyifangreeneyes Dec 1, 2022
ff89ef2
planner: fill plan digest when create binding from existing plan (#39…
fzzf678 Dec 1, 2022
3f3e102
executor: make analyze killable by oom action (#39539)
chrysan Dec 1, 2022
7dedfab
executor: refactor hashjoin part6 (#39531)
XuHuaiyu Dec 1, 2022
38b0ab7
planner: prohibit StreamAgg with group keys for TiFlash (#39547)
fixdb Dec 1, 2022
dd32b9e
util: add unit tests for password validation (#39540)
CbcWestwolf Dec 1, 2022
272d328
meta/autoid: fix AUTO_ID_CACHE 1 setting affect row id allocator perf…
tiancaiamao Dec 1, 2022
2914d8d
backup: fix the object lock check with other s3 compatible storage (#…
3pointer Dec 1, 2022
2548e66
txn: respect txn-total-size-limit if it is manually set (#39550)
ekexium Dec 1, 2022
40d1ddb
*: support password reuse policy (#39162)
bob34007 Dec 2, 2022
10b3bc7
lightning: refine progress for compress files import (#39219)
lichunzhu Dec 2, 2022
4d11314
plan: refine build plan and skip privilege check for foreign key casc…
crazycs520 Dec 2, 2022
eed9ceb
import: fix dup-detect failure on index data (#39571)
dsdashun Dec 2, 2022
6b4739f
planner: change the stage of count star rewriter rule from logical to…
elsa0520 Dec 2, 2022
62b4e44
planner: fix create binding for prepare from history can't work (#39577)
fzzf678 Dec 2, 2022
7f2ae40
expression: Add json_extract, cast(json as string), json_unquote push…
yibin87 Dec 2, 2022
f799e72
store/copr: disable batch store copr when paging is enabled (#39580)
you06 Dec 2, 2022
cabc018
ddl: improve the log messages and refine code (#39456)
tangenta Dec 2, 2022
34c2a78
planner, ddl: fix hash partition with adding new column (#39574)
wjhuang2016 Dec 2, 2022
0470fa3
ddl: fix issue of add foreign key failed but doesn't rollback (#39583)
crazycs520 Dec 2, 2022
4293053
ddl: move foreign test to speed up ci (#39587)
crazycs520 Dec 2, 2022
824ef60
*: support password expiration policy (#39035)
CbcWestwolf Dec 2, 2022
62557e2
readme, docs: update architecture, logo, wording (#39544)
lilin90 Dec 2, 2022
c3b89e7
mathutil: support exponential average (#39484)
hawkingrei Dec 2, 2022
d045b41
ttl,ddl: disable ttl for fk and temp table (#39581)
YangKeao Dec 2, 2022
e89f341
log-backup: do not rewrite shortvalue iif the value is rollback recor…
joccau Dec 2, 2022
0b1096e
sysvar: fix inconsistency in setting password validation sysvars (#39…
CbcWestwolf Dec 3, 2022
7a1ea93
br: fix br foreign key test (#39607)
crazycs520 Dec 5, 2022
d5885e5
*: simple code for readProjection (#39600)
hawkingrei Dec 5, 2022
e1cc961
dumpling: Set default driverCfg to use TLS first (#39423)
Daemonxiao Dec 5, 2022
2d30149
ttl: Implement scan and delete task for TTL (#39481)
lcwangchao Dec 5, 2022
a7c4c71
ttl: add system table for TTL status (#39315)
YangKeao Dec 5, 2022
0219087
*: fix etcd fail to build on the m1 (#39608)
hawkingrei Dec 5, 2022
e320092
br: fix bug of checkpoint ticker leak (#39622)
sourcelliu Dec 5, 2022
b770bc6
ttl: add info schema cache and ttl table status table cache for ttl s…
YangKeao Dec 5, 2022
7af9eb6
parser: supports create/alter/drop resource group (#39546)
nolouch Dec 5, 2022
5127ad2
statistics: add historical stats testcase (#39612)
Yisaer Dec 5, 2022
35819ee
import: check table empty skips using index (#39604)
dsdashun Dec 5, 2022
71863b4
txn: fix the panic when memdb grows beyond quota (#39621)
ekexium Dec 5, 2022
35319e8
planner: forbid [batch] point get with update read choose tiflash as …
Yisaer Dec 5, 2022
3ee869e
ttl: fix data race in `ttlDeleteWorker` (#39635)
lcwangchao Dec 6, 2022
46ee6af
executor: fix data race in the slowQueryRuntimeStats (#39630)
hawkingrei Dec 6, 2022
1ddc592
planner: update the cost formula of IndexJoin+IndexLookup (#39617)
qw4990 Dec 6, 2022
2ca37cb
planner: throw error when create not supported binding from history (…
fzzf678 Dec 6, 2022
a54faad
*: fix revive false positive with generics (#39666)
hawkingrei Dec 6, 2022
8b76580
backup: config adjust for checkpoint (#39634)
Leavrth Dec 6, 2022
dc6d9a0
util, executor: fix the problem that GetDatumWithBuffer does set null…
XuHuaiyu 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
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
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
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
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
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
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
startup --host_jvm_args=-Xmx5g
startup --host_jvm_args=-Xmx8g
startup --unlimit_coredumps

run:ci --color=yes
Expand Down
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
time: "18:00"
timezone: "Asia/Shanghai"
allow:
- dependency-name: "golang.org/*"
- dependency-name: "github.com/golangci/golangci-lint"
open-pull-requests-limit: 2

16 changes: 8 additions & 8 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4425,8 +4425,8 @@ def go_deps():
name = "org_golang_x_net",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/net",
sum = "h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=",
version = "v0.2.0",
sum = "h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=",
version = "v0.4.0",
)
go_repository(
name = "org_golang_x_oauth2",
Expand All @@ -4453,22 +4453,22 @@ def go_deps():
name = "org_golang_x_term",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/term",
sum = "h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=",
version = "v0.2.0",
sum = "h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=",
version = "v0.3.0",
)
go_repository(
name = "org_golang_x_text",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/text",
sum = "h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=",
version = "v0.4.0",
sum = "h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=",
version = "v0.5.0",
)
go_repository(
name = "org_golang_x_time",
build_file_proto_mode = "disable_global",
importpath = "golang.org/x/time",
sum = "h1:52I/1L54xyEQAYdtcSuxtiT84KGYTBGXwayxmIpNJhE=",
version = "v0.2.0",
sum = "h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=",
version = "v0.3.0",
)
go_repository(
name = "org_golang_x_tools",
Expand Down
9 changes: 9 additions & 0 deletions bindinfo/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,15 @@ func (h *BindHandle) SetBindRecordStatus(originalSQL string, binding *Binding, n
return
}

// SetBindRecordStatusByDigest set a BindRecord's status to the storage and bind cache.
func (h *BindHandle) SetBindRecordStatusByDigest(newStatus, sqlDigest string) (ok bool, err error) {
oldRecord, err := h.GetBindRecordBySQLDigest(sqlDigest)
if err != nil {
return false, err
}
return h.SetBindRecordStatus(oldRecord.OriginalSQL, nil, newStatus)
}

// GCBindRecord physically removes the deleted bind records in mysql.bind_info.
func (h *BindHandle) GCBindRecord() (err error) {
h.bindInfo.Lock()
Expand Down
6 changes: 5 additions & 1 deletion br/pkg/aws/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ go_test(
name = "aws_test",
srcs = ["ebs_test.go"],
embed = [":aws"],
deps = ["@com_github_stretchr_testify//require"],
deps = [
"@com_github_aws_aws_sdk_go//aws",
"@com_github_aws_aws_sdk_go//service/ec2",
"@com_github_stretchr_testify//require",
],
)
31 changes: 20 additions & 11 deletions br/pkg/aws/ebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,9 @@ func (e *EC2Session) WaitVolumesCreated(volumeIDMap map[string]string, progress
return 0, errors.Trace(err)
}

var unfinishedVolumes []*string
for _, volume := range resp.Volumes {
if *volume.State == ec2.VolumeStateAvailable {
log.Info("volume is available", zap.String("id", *volume.SnapshotId))
totalVolumeSize += *volume.Size
progress.Inc()
} else {
log.Debug("volume creating...", zap.Stringer("volume", volume))
unfinishedVolumes = append(unfinishedVolumes, volume.SnapshotId)
}
}
createdVolumeSize, unfinishedVolumes := e.HandleDescribeVolumesResponse(resp)
progress.IncBy(int64(len(pendingVolumes) - len(unfinishedVolumes)))
totalVolumeSize += createdVolumeSize
pendingVolumes = unfinishedVolumes
}
log.Info("all pending volume are created.")
Expand Down Expand Up @@ -357,3 +349,20 @@ func (e *EC2Session) DeleteVolumes(volumeIDMap map[string]string) {
func ec2Tag(key, val string) *ec2.Tag {
return &ec2.Tag{Key: &key, Value: &val}
}

func (e *EC2Session) HandleDescribeVolumesResponse(resp *ec2.DescribeVolumesOutput) (int64, []*string) {
totalVolumeSize := int64(0)

var unfinishedVolumes []*string
for _, volume := range resp.Volumes {
if *volume.State == ec2.VolumeStateAvailable {
log.Info("volume is available", zap.String("id", *volume.VolumeId))
totalVolumeSize += *volume.Size
} else {
log.Debug("volume creating...", zap.Stringer("volume", volume))
unfinishedVolumes = append(unfinishedVolumes, volume.VolumeId)
}
}

return totalVolumeSize, unfinishedVolumes
}
53 changes: 45 additions & 8 deletions br/pkg/aws/ebs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,63 @@ package aws
import (
"testing"

awsapi "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/stretchr/testify/require"
)

func TestEC2SessionExtractSnapProgress(t *testing.T) {
strPtr := func(s string) *string {
return &s
}
tests := []struct {
str *string
want int64
}{
{nil, 0},
{strPtr("12.12%"), 12},
{strPtr("44.99%"), 44},
{strPtr(" 89.89% "), 89},
{strPtr("100%"), 100},
{strPtr("111111%"), 100},
{awsapi.String("12.12%"), 12},
{awsapi.String("44.99%"), 44},
{awsapi.String(" 89.89% "), 89},
{awsapi.String("100%"), 100},
{awsapi.String("111111%"), 100},
}
e := &EC2Session{}
for _, tt := range tests {
require.Equal(t, tt.want, e.extractSnapProgress(tt.str))
}
}

func createVolume(snapshotId string, volumeId string, state string) *ec2.Volume {
return &ec2.Volume{
Attachments: nil,
AvailabilityZone: awsapi.String("us-west-2"),
CreateTime: nil,
Encrypted: awsapi.Bool(true),
FastRestored: awsapi.Bool(true),
Iops: awsapi.Int64(3000),
KmsKeyId: nil,
MultiAttachEnabled: awsapi.Bool(true),
OutpostArn: awsapi.String("arn:12342"),
Size: awsapi.Int64(1),
SnapshotId: awsapi.String(snapshotId),
State: awsapi.String(state),
Tags: nil,
Throughput: nil,
VolumeId: awsapi.String(volumeId),
VolumeType: awsapi.String("gp3"),
}
}
func TestHandleDescribeVolumesResponse(t *testing.T) {
curentVolumesStates := &ec2.DescribeVolumesOutput{
NextToken: awsapi.String("fake token"),
Volumes: []*ec2.Volume{
createVolume("snap-0873674883", "vol-98768979", "available"),
createVolume("snap-0873674883", "vol-98768979", "creating"),
createVolume("snap-0873674883", "vol-98768979", "available"),
createVolume("snap-0873674883", "vol-98768979", "available"),
createVolume("snap-0873674883", "vol-98768979", "available"),
},
}

e := &EC2Session{}
createdVolumeSize, unfinishedVolumes := e.HandleDescribeVolumesResponse(curentVolumesStates)
require.Equal(t, int64(4), createdVolumeSize)
require.Equal(t, 1, len(unfinishedVolumes))
}
2 changes: 1 addition & 1 deletion br/pkg/lightning/backend/kv/sql2kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func collectGeneratedColumns(se *session, meta *model.TableInfo, cols []*table.C
var genCols []genCol
for i, col := range cols {
if col.GeneratedExpr != nil {
expr, err := expression.RewriteAstExpr(se, col.GeneratedExpr, schema, names)
expr, err := expression.RewriteAstExpr(se, col.GeneratedExpr, schema, names, false)
if err != nil {
return nil, err
}
Expand Down
Binary file not shown.
99 changes: 96 additions & 3 deletions br/pkg/lightning/mydump/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package mydump

import (
"context"
"io"
"path/filepath"
"sort"
"strings"
Expand All @@ -30,6 +31,9 @@ import (
"go.uber.org/zap"
)

// sampleCompressedFileSize represents how many bytes need to be sampled for compressed files
const sampleCompressedFileSize = 4 * 1024

// MDDatabaseMeta contains some parsed metadata for a database in the source by MyDumper Loader.
type MDDatabaseMeta struct {
Name string
Expand Down Expand Up @@ -82,7 +86,9 @@ type SourceFileMeta struct {
Compression Compression
SortKey string
FileSize int64
ExtendData ExtendColumnData
// WARNING: variables below are not persistent
ExtendData ExtendColumnData
RealSize int64
}

// NewMDTableMeta creates an Mydumper table meta with specified character set.
Expand Down Expand Up @@ -386,7 +392,7 @@ func (s *mdLoaderSetup) setup(ctx context.Context) error {
// set a dummy `FileInfo` here without file meta because we needn't restore the table schema
tableMeta, _, _ := s.insertTable(FileInfo{TableName: fileInfo.TableName})
tableMeta.DataFiles = append(tableMeta.DataFiles, fileInfo)
tableMeta.TotalSize += fileInfo.FileMeta.FileSize
tableMeta.TotalSize += fileInfo.FileMeta.RealSize
}

for _, dbMeta := range s.loader.dbs {
Expand Down Expand Up @@ -453,7 +459,7 @@ func (s *mdLoaderSetup) constructFileInfo(ctx context.Context, path string, size

info := FileInfo{
TableName: filter.Table{Schema: res.Schema, Name: res.Name},
FileMeta: SourceFileMeta{Path: path, Type: res.Type, Compression: res.Compression, SortKey: res.Key, FileSize: size},
FileMeta: SourceFileMeta{Path: path, Type: res.Type, Compression: res.Compression, SortKey: res.Key, FileSize: size, RealSize: size},
}

if s.loader.shouldSkip(&info.TableName) {
Expand All @@ -470,6 +476,15 @@ func (s *mdLoaderSetup) constructFileInfo(ctx context.Context, path string, size
case SourceTypeViewSchema:
s.viewSchemas = append(s.viewSchemas, info)
case SourceTypeSQL, SourceTypeCSV, SourceTypeParquet:
if info.FileMeta.Compression != CompressionNone {
compressRatio, err2 := SampleFileCompressRatio(ctx, info.FileMeta, s.loader.GetStore())
if err2 != nil {
logger.Error("[loader] fail to calculate data file compress ratio",
zap.String("schema", res.Schema), zap.String("table", res.Name), zap.Stringer("type", res.Type))
} else {
info.FileMeta.RealSize = int64(compressRatio * float64(info.FileMeta.FileSize))
}
}
s.tableDatas = append(s.tableDatas, info)
}

Expand Down Expand Up @@ -648,3 +663,81 @@ func (l *MDLoader) GetDatabases() []*MDDatabaseMeta {
func (l *MDLoader) GetStore() storage.ExternalStorage {
return l.store
}

func calculateFileBytes(ctx context.Context,
dataFile string,
compressType storage.CompressType,
store storage.ExternalStorage,
offset int64) (tot int, pos int64, err error) {
bytes := make([]byte, sampleCompressedFileSize)
reader, err := store.Open(ctx, dataFile)
if err != nil {
return 0, 0, errors.Trace(err)
}
defer reader.Close()

compressReader, err := storage.NewLimitedInterceptReader(reader, compressType, offset)
if err != nil {
return 0, 0, errors.Trace(err)
}

readBytes := func() error {
n, err2 := compressReader.Read(bytes)
if err2 != nil && errors.Cause(err2) != io.EOF && errors.Cause(err) != io.ErrUnexpectedEOF {
return err2
}
tot += n
return err2
}

if offset == 0 {
err = readBytes()
if err != nil && errors.Cause(err) != io.EOF && errors.Cause(err) != io.ErrUnexpectedEOF {
return 0, 0, err
}
pos, err = compressReader.Seek(0, io.SeekCurrent)
if err != nil {
return 0, 0, errors.Trace(err)
}
return tot, pos, nil
}

for {
err = readBytes()
if err != nil {
break
}
}
if err != nil && errors.Cause(err) != io.EOF && errors.Cause(err) != io.ErrUnexpectedEOF {
return 0, 0, errors.Trace(err)
}
return tot, offset, nil
}

// SampleFileCompressRatio samples the compress ratio of the compressed file.
func SampleFileCompressRatio(ctx context.Context, fileMeta SourceFileMeta, store storage.ExternalStorage) (float64, error) {
if fileMeta.Compression == CompressionNone {
return 1, nil
}
compressType, err := ToStorageCompressType(fileMeta.Compression)
if err != nil {
return 0, err
}
// We use the following method to sample the compress ratio of the first few bytes of the file.
// 1. read first time aiming to find a valid compressed file offset. If we continue read now, the compress reader will
// request more data from file reader buffer them in its memory. We can't compute an accurate compress ratio.
// 2. we use a second reading and limit the file reader only read n bytes(n is the valid position we find in the first reading).
// Then we read all the data out from the compress reader. The data length m we read out is the uncompressed data length.
// Use m/n to compute the compress ratio.
// read first time, aims to find a valid end pos in compressed file
_, pos, err := calculateFileBytes(ctx, fileMeta.Path, compressType, store, 0)
if err != nil {
return 0, err
}
// read second time, original reader ends at first time's valid pos, compute sample data compress ratio
tot, pos, err := calculateFileBytes(ctx, fileMeta.Path, compressType, store, pos)
if err != nil {
return 0, err
}
return float64(tot) / float64(pos), nil
}
33 changes: 33 additions & 0 deletions br/pkg/lightning/mydump/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package mydump_test

import (
"bytes"
"compress/gzip"
"context"
"fmt"
"os"
Expand Down Expand Up @@ -1053,3 +1055,34 @@ func TestExternalDataRoutes(t *testing.T) {
require.Equal(t, expectedExtendVals[i], fileInfo.FileMeta.ExtendData.Values)
}
}

func TestSampleFileCompressRatio(t *testing.T) {
s := newTestMydumpLoaderSuite(t)
store, err := storage.NewLocalStorage(s.sourceDir)
require.NoError(t, err)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

byteArray := make([]byte, 0, 4096)
bf := bytes.NewBuffer(byteArray)
compressWriter := gzip.NewWriter(bf)
csvData := []byte("aaaa\n")
for i := 0; i < 1000; i++ {
_, err = compressWriter.Write(csvData)
require.NoError(t, err)
}
err = compressWriter.Flush()
require.NoError(t, err)

fileName := "test_1.t1.csv.gz"
err = store.WriteFile(ctx, fileName, bf.Bytes())
require.NoError(t, err)

ratio, err := md.SampleFileCompressRatio(ctx, md.SourceFileMeta{
Path: fileName,
Compression: md.CompressionGZ,
}, store)
require.NoError(t, err)
require.InDelta(t, ratio, 5000.0/float64(bf.Len()), 1e-5)
}
Loading