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

vector: Merge upstream #55549

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
628b7ed
planner: deprecate index lookup merge join. (#54681)
AilinKid Jul 25, 2024
661dfae
planner: classify logical expand logic into a separate file for later…
AilinKid Jul 25, 2024
d12f841
mod: update pd-client to fix the resource limiter issue (#54898)
nolouch Jul 25, 2024
77c97ef
planner: move logical cte table into logicalop pkg. (#54905)
AilinKid Jul 25, 2024
ee64347
planner: remove useless check (#54907)
Rustin170506 Jul 25, 2024
6c3e25e
*: avoid using Tables field of model.DBInfo, use API instead (#52302)
tiancaiamao Jul 25, 2024
cf4bb51
ddl: assign table IDs for jobs submitted to queue (#54880)
tangenta Jul 25, 2024
b41ad70
*: refine pipelined dml benchmarks (#54844)
ekexium Jul 25, 2024
7e73ddc
statistics: add metrics for unneeded analyze table (#54822)
hawkingrei Jul 26, 2024
0353655
executor: fix index_hash_join hang when context canceled (#54855)
wshwsh12 Jul 26, 2024
2ee8c99
table: Add `CachedTableSupport` and `TemporaryTableSupport` for `Muta…
lcwangchao Jul 26, 2024
87d1657
planner: move logical mem-table to logicalop pkg. (#54903)
AilinKid Jul 26, 2024
e0e8f89
lightning: fix SET SESSION on connection pool (#54927)
lance6716 Jul 26, 2024
e366584
ddl: fix a data race on localRowCntListener Written() (#54484)
River2000i Jul 26, 2024
0dff610
resource_control: support unlimited keyword when setting the resource…
HuSharp Jul 26, 2024
da7d83f
privilege: Remove TestAbnormalMySQLTable (#54925)
dveeden Jul 26, 2024
b2eb21a
planner: move logical show into logicalop pkg. (#54928)
AilinKid Jul 26, 2024
d38528a
test: fix flaky test TestFailSchemaSyncer (#54958)
D3Hunter Jul 26, 2024
97c2428
planner: use code-gen to generate CloneForPlanCache method for some o…
qw4990 Jul 26, 2024
0abf3ae
planner: import more expand test. (#54962)
AilinKid Jul 26, 2024
a8d29c2
expression: fix infinity loop in `timestampadd` (#54916)
xzhangxian1008 Jul 26, 2024
197476a
br: cli refactor backup error handling logic (#54697)
Jul 26, 2024
56710ae
planner: derive index filters for mv index paths (#54877)
time-and-fate Jul 26, 2024
7cdf918
disjoinset: add generic impl (#54917)
winoros Jul 27, 2024
7ffc7c9
ddl: re-structure job scheduler and ddl executor, part 1 (#54967)
D3Hunter Jul 29, 2024
f2abe99
planner: push necessary predicates without virtual column down throug…
qw4990 Jul 29, 2024
02cbd14
planner: fix extract correlated column for expand in building phase w…
AilinKid Jul 29, 2024
108e98a
ddl: init global vars from system tables before start domain (#54913)
D3Hunter Jul 29, 2024
247b06e
meta,infoschema: fix a bug that after HasTemporaryTable() wrong infos…
tiancaiamao Jul 29, 2024
9bda5d2
planner: move logical show ddl jobs to logicalop pkg. (#54930)
AilinKid Jul 29, 2024
c5185cb
executor: `runWithSystemSession` also copy snapshot status (#54989)
lance6716 Jul 29, 2024
069258e
planner: move projection elimination related ReplaceExpr/Column code …
AilinKid Jul 29, 2024
e92baf9
planner: move logical sequence into logicalop pkg. (#54955)
AilinKid Jul 29, 2024
e05955a
infoschema: fix a snapshot infoschema cache bug after v1 v2 switch (#…
tiancaiamao Jul 29, 2024
0d10526
planner: add some output when a flaky test fails (#54980)
winoros Jul 29, 2024
c517ffb
tests: let clustered_index.test use v2 stats and cost (#54885)
winoros Jul 29, 2024
273ca66
*: remove limiting process id for auto analyze (#54902)
hawkingrei Jul 29, 2024
60c7e61
planner: column pruning must reserve at least one column (#54778)
winoros Jul 29, 2024
199bf90
executor: try to optimize index hash join query by reduce cop task co…
crazycs520 Jul 30, 2024
5d5de41
planner: import more tests about rollup expand (#55024)
AilinKid Jul 30, 2024
704efb3
metrics: add memory info and traffic flow into performance overview (…
dbsid Jul 30, 2024
40ac334
br: fix br domain start (#55038)
D3Hunter Jul 30, 2024
3fd284b
planner: add more test cases for Plan Clone (#55011)
qw4990 Jul 30, 2024
af9c839
executor: fix issue that update ignore stmt return error when meet in…
crazycs520 Jul 30, 2024
0ad2ca6
ddl, partition: fix del_range for add global index (#55020)
Defined2014 Jul 31, 2024
e494895
ddl: merge continuous key ranges in FLASHBACK CLUSTER job args (#54914)
lance6716 Jul 31, 2024
383643f
planner: simplify the indexJoinBuildHelper structure (#55079)
qw4990 Jul 31, 2024
73e3425
statistics: do not copy and paste the code for saving statistics (#55…
Rustin170506 Jul 31, 2024
05853dd
infoschema: adapt TableByName for query of memory table (#54918)
tangenta Jul 31, 2024
aaca081
ddl: record get owner TS and compare it before runReorgJob quit (#55049)
tangenta Jul 31, 2024
a690a77
planner: move logical table dual to logicalop pkg. (#55018)
AilinKid Jul 31, 2024
3a93c73
ttl: fix cancel job message for TTL (#55099)
lcwangchao Jul 31, 2024
b944d5d
planner: use code-gen to generate CloneForPlanCache method for Point/…
qw4990 Jul 31, 2024
41bb8f5
ddl: integrate fast create table into normal general DDL workflow (#5…
D3Hunter Jul 31, 2024
b59f5ec
statistics: add a thread-safe heap (#55064)
Rustin170506 Jul 31, 2024
a187e9d
ddl, partition: report error when interval partition create partition…
Defined2014 Aug 1, 2024
8c7abde
infoschema: fix foreign key building using schema cache V2 (#54959)
wjhuang2016 Aug 1, 2024
68b529e
ddl: replace `OnJobUpdated` callback with failpoint (#55091)
lance6716 Aug 1, 2024
1277c72
*: fix query reports ScalarFunction is not supported in batch mode (#…
hawkingrei Aug 1, 2024
c97ac46
planner: move logical limit/topn/sort into logicalop pkg. (#55115)
AilinKid Aug 1, 2024
b5555c3
*: update client-go to track correct durations (#55082)
ekexium Aug 1, 2024
5c2dde8
executor, expression: detach projection and selection operator (#54864)
YangKeao Aug 1, 2024
da7ed5c
ddl: remove unused code related to prev fast create impl (#55116)
D3Hunter Aug 1, 2024
b0aced8
util: Resolve RuntimeStatsColl potential unlock mutex (#55118)
Aug 1, 2024
fdcb2e4
planner: move logical projection into logicalop pkg. (#55135)
AilinKid Aug 1, 2024
966e000
planner: simplify the indexJoinBuildHelper structure (#55136)
qw4990 Aug 1, 2024
194711a
planner: fix index out of range in constructIndexJoinInnerSideTask (#…
joechenrh Aug 1, 2024
2945819
Planner: Estimate to recognize modifyCount when all TopN collected (#…
terry1purcell Aug 1, 2024
1536aa8
store/copr: revert pr/35975, do not reduce concurrency for keep order…
tiancaiamao Aug 2, 2024
94d8c12
planner: simplify the indexJoinBuildHelper structure (#55150)
qw4990 Aug 2, 2024
f85273b
executor: fix correctness of hash join v2 when there are multiple var…
windtalker Aug 2, 2024
efd57c6
planner: Add Revision check in tryLockMDLAndUpdateSchemaIfNecessary (…
joechenrh Aug 2, 2024
801d5d6
planner: fix column evaluator can not detect input's column-ref and t…
AilinKid Aug 2, 2024
43e56bd
ddl: re-structure ddl executor part 2 (#55140)
D3Hunter Aug 2, 2024
8b787f7
planner: use code-gen to generate CloneForPlanCache method for IndexJ…
qw4990 Aug 2, 2024
5a44248
planner: move logical window into logicalop pkg. (#55158)
AilinKid Aug 2, 2024
af962a7
planner: Optimized EXTRACT(<UNIT> FROM <partition_column>) for partit…
mjonss Aug 2, 2024
52303d4
ddl: replace `OnJobRunAfter` callback with failpoint (#55120)
lance6716 Aug 2, 2024
7e4608f
executor: Avoid too many concurrent atomic update in probe collision …
windtalker Aug 3, 2024
52b4c8a
domain,infoschema: avoid v1/v2 switch when loading snapshot infoschem…
tiancaiamao Aug 3, 2024
ce45eff
br: error if the log restore has no full backup schema or id maps (#5…
Leavrth Aug 5, 2024
f3e153a
executor: filter on `table_schema` for `INFORMATION_SCHEMA.KEY_COLUMN…
YangKeao Aug 5, 2024
2c47cd5
br: set memory limit (#53793)
Leavrth Aug 5, 2024
9a2da2d
table: refactor options for `Table.AddRecord/Table.UpdateRecord/Index…
lcwangchao Aug 5, 2024
6e03d23
infosync: correct the PD API call of GetLabelRules (#55189)
JmPotato Aug 5, 2024
5aad7df
*: use a unified session pool definition AMAP (#55170)
JmPotato Aug 5, 2024
a1606cf
metrics: add per-query-statement RPC count and scan processed key cou…
HaoW30 Aug 6, 2024
d383367
planner: add new variables for instance plan cache (#55193)
qw4990 Aug 6, 2024
07c35e8
planner/core: define extractor for each schema related memtables (#55…
tangenta Aug 6, 2024
fa554f8
planner: use code-gen to generate CloneForPlanCache method for Insert…
qw4990 Aug 6, 2024
9fee330
store/copr: partly revert pr/35975, do it correctly this time (#55196)
tiancaiamao Aug 6, 2024
1985662
table: add new option `DupKeyCheckMode` for table mutations (#55194)
lcwangchao Aug 6, 2024
1fb4019
infoschema: rewrite SchemaSimpleTableInfos for infoschema v2 to avoid…
tiancaiamao Aug 6, 2024
0e43ba0
executor: add heap object can move check for hash join v2 (#55200)
windtalker Aug 6, 2024
de943d1
planner: avoid nil PhysicalProperty when to build agg (#55201)
hawkingrei Aug 6, 2024
d253737
table: Add option `SkipWriteUntouchedIndices` for `Table.UpdateRecord…
lcwangchao Aug 6, 2024
5458324
tests: update mysql-tester (#55216)
Defined2014 Aug 6, 2024
3b19de6
infoschema,executor: change TableByID to skip refill infoschema v2 ca…
tiancaiamao Aug 6, 2024
ffaefa9
planner: add metrics for instance plan cache (#55218)
qw4990 Aug 6, 2024
977a5bf
infoschema: support cached table for infoschema v2 (#55139)
tiancaiamao Aug 6, 2024
dff0d7c
ddl: fix flaky TestGenIDAndInsertJobsWithRetry (#55233)
D3Hunter Aug 6, 2024
1cd11bc
executor: disable hash join v2 (#55224)
windtalker Aug 6, 2024
d940b7d
*: init ctx for extractWorker (#55228)
lance6716 Aug 6, 2024
7d0abb9
planner/core: filter temp tables for information_schema (#55209)
tangenta Aug 6, 2024
7291829
executor: fix the issue that some extracted conditions are not used i…
YangKeao Aug 7, 2024
3dfa15c
planner: move logical lock into logicalop pkg. (#55160)
AilinKid Aug 7, 2024
165ef9d
executor: add test for same table name in two schemas (#55222)
tangenta Aug 7, 2024
395c6e7
planner: incorrect query result using ISNULL (#54819)
hawkingrei Aug 7, 2024
3117d3f
planner: classify logical optimizing rule interface and files. (#55226)
AilinKid Aug 7, 2024
f387d19
planner: move logical union scan into logicalop pkg. (#55159)
AilinKid Aug 7, 2024
dfa7ea6
*: replace ddl callback injection with failpoint (#55215)
lance6716 Aug 7, 2024
7746eac
*: upgrade go1.21.13 (#55244)
hawkingrei Aug 7, 2024
686f8bc
statistics: move history-related functions into the stats handle (#55…
Rustin170506 Aug 7, 2024
724b7ed
pkg/planner, tests: set the AvoidColumnEvaluator correctly in Project…
XuHuaiyu Aug 7, 2024
c981864
session: update comments for statistics related variables (#55220)
Rustin170506 Aug 7, 2024
45e466d
tools: run `make generate` on parser directory (#55247)
Defined2014 Aug 7, 2024
2ce3cdb
br: fix checkpoint path (#55266)
Leavrth Aug 7, 2024
1ee9efa
planner: add `PhysicalJoin` interface and move and split methods in `…
time-and-fate Aug 7, 2024
f6fe03d
parser: change keyword `TiDB_CURRENT_TSO` to `TIDB_CURRENT_TSO` (#55258)
Defined2014 Aug 8, 2024
0a2d5be
*: update tikv/client-go for fix issue that store's liveness may inco…
crazycs520 Aug 8, 2024
d0c1ca1
planner: remove useless pointer receiver implementation. (#55292)
AilinKid Aug 8, 2024
ed1ebbb
metric/resource_control: append write dimension of the RU max metric …
HuSharp Aug 8, 2024
4cfc182
tools/ut.go: replace path with filepath (#55122)
HuSharp Aug 8, 2024
a9a5b97
lightning: optimize checkpoint size (#55230)
D3Hunter Aug 8, 2024
3357f26
test: port unit test from #55286 to master (#55293)
lance6716 Aug 8, 2024
d4c26ca
table: Add option `DupKeyCheckLazy` to check duplicated key lazily (#…
lcwangchao Aug 8, 2024
a541a4f
pkg/executor,tests: reset params in the PipelineWindow.Open (#54709)
XuHuaiyu Aug 8, 2024
8104898
planner: use code-gen to generate CloneForPlanCache method for Select…
qw4990 Aug 8, 2024
99857e3
server: add tidb_enable_shared_lock_promotion to support for share lo…
cfzjywxk Aug 8, 2024
0cfa66f
*: add tiflash_hashagg_preaggregation_mode sys var (#54186)
guo-shaoge Aug 8, 2024
cf2c703
ddl: remove unused `copReqSenderPool` and related structures (#55302)
tangenta Aug 8, 2024
829bd5b
table: fix some txn assertion error when executing DDL and DML (#55314)
lcwangchao Aug 9, 2024
2a731e6
planner: support using "KiB/MiB/GiB" to set isntance_plan_cache_targe…
qw4990 Aug 9, 2024
b066365
*: kill auto analyze out of the auto analyze time windows (#55062)
hawkingrei Aug 9, 2024
29122de
ddl: clone table for show columns (#55309)
GMHDBJD Aug 9, 2024
5d867dd
ddl: improve priority of suppressErrorTooLongKeyKey for DM (#55164)
lance6716 Aug 9, 2024
fd3ad81
*: support to query init stats percentage from http api (#55323)
hawkingrei Aug 9, 2024
e1f2b77
parser: support GLOBAL IndexOption (#55259)
mjonss Aug 9, 2024
bf7c8b1
table: make `AddRecordOpt`/`UpdateRecordOpt`/`CreateIdxOpt` immutable…
lcwangchao Aug 9, 2024
2c9a45c
test: fix data conflict in `TestCursorWillBlockMinStartTS` (#55326)
YangKeao Aug 9, 2024
4d384d3
planner: add protection to avoid setting `tot_col_size` to negative n…
qw4990 Aug 9, 2024
876268f
*: add ctx parameter to infoschema TableByID (#55329)
lance6716 Aug 9, 2024
240702e
planner: move base physical plan into physicalop pkg. (#55131)
AilinKid Aug 9, 2024
2675c66
variable: fix data race in `GetTemporaryTable` (#55338)
lcwangchao Aug 9, 2024
6df7aba
planner: support generating `leading` and `hash_join_build` hint from…
time-and-fate Aug 9, 2024
5a98bf3
*: upgrade bazel rules (#55347)
hawkingrei Aug 12, 2024
d6dda3d
runaway: add runaway tidb-side time checker (#54987)
HuSharp Aug 12, 2024
3708722
ddl/domain: disallow set schema lease to 0 (#55312)
D3Hunter Aug 12, 2024
d78bb91
gc_worker: make deleteRanges concurrent (#54571)
ekexium Aug 12, 2024
004b442
pkg/planner: set proj.AvoidColumnEvaluator in postOptimize (#55333)
XuHuaiyu Aug 12, 2024
2abd334
planner: move logical join and logical selection to logicalop (#55272)
AilinKid Aug 12, 2024
813fe19
executor, infoschema: filter out the PRIMARY index and foreign keys i…
YangKeao Aug 12, 2024
67d6e70
executor: fix incorrect result when hash agg spill is triggered (#55322)
xzhangxian1008 Aug 12, 2024
51d57aa
*: rename current_affected_rows to rows_affected (#54921)
ekexium Aug 12, 2024
e767f86
executor: try to optimize index join query by reduce cop task count (…
crazycs520 Aug 12, 2024
66e192d
tables: remove unnecessary function (#55361)
Defined2014 Aug 12, 2024
43677f4
br: resolve stuck in progress (#54790)
Leavrth Aug 12, 2024
bc0af68
planner: add more test cases for instance plan cache (#55363)
qw4990 Aug 12, 2024
4baaa18
infoschema: update two tests to make them robust and a tiny fix (#55362)
tiancaiamao Aug 12, 2024
4764397
ddl: restructure schema version and server state syncer (#55368)
D3Hunter Aug 12, 2024
2fb61a5
*: Require GLOBAL IndexOption for creating Global Index (#55264)
mjonss Aug 12, 2024
cde5603
*: fix flaky test TestRecordHistoryStatsAfterAnalyze (#55365)
hawkingrei Aug 12, 2024
6a34088
server: support global scope for tidb_low_resolution_tso sys var (#55…
cfzjywxk Aug 12, 2024
1f40cb0
*: support batch create/drop bindings from plan/sql digest (#55315)
time-and-fate Aug 12, 2024
29d52a7
meta, util: skip unmarshal unneeded JSON fields (#55304)
lance6716 Aug 13, 2024
9a7e5cc
planner: incorrect query result using ISNULL in the nested expression…
hawkingrei Aug 13, 2024
3db0322
ddl: support session level tidb_ddl_reorg_worker_cnt and batch_size (…
tangenta Aug 13, 2024
fcc2f72
planner: move logical aggregation to logicalop pkg (#55371)
AilinKid Aug 13, 2024
bc6a18d
*: update v2 infoschema reader support for tables Indexes, Views, Key…
tiancaiamao Aug 13, 2024
7e9f853
planner: move `rule_constant_propagation` to rule pkg. (#55231) (#55345)
qingfeng777 Aug 13, 2024
3c30925
lightning: fix flaky integration test (#55382)
D3Hunter Aug 13, 2024
bbe5266
planner/core: infoschema tables should show global temp tables (#55379)
tangenta Aug 13, 2024
f9e9b14
*: bump client-go to adopt new batch policy (#55383)
zyguan Aug 13, 2024
89bb81b
planner: add more test cases for instance plan cache (#55385)
qw4990 Aug 13, 2024
d04299e
br: resolve stuck in backup (#54736)
Leavrth Aug 13, 2024
594d02a
planner: add more log and metrics for instance plan cache eviction (#…
qw4990 Aug 13, 2024
bab3667
executor: fix data race in hash agg spill test (#55387)
xzhangxian1008 Aug 13, 2024
0e47f9a
table: Add `PessimisticLazyDupKeyCheckMode` to determine lazy mode in…
lcwangchao Aug 14, 2024
70381ea
*: enable infoschema v2 by default (#55229)
tiancaiamao Aug 14, 2024
c48e53a
kv: reduce the distsql concurrency if the runaway query action is COO…
nolouch Aug 14, 2024
cfcd164
*: update extractor for tidb_index_usage and columns table (#55263)
joechenrh Aug 14, 2024
eeb3d73
planner: move logical apply to logicalop pkg. (#55370)
AilinKid Aug 14, 2024
aa4e2b3
planner/core: define extractors for sequences and constraints memtabl…
tangenta Aug 14, 2024
afd7b97
domain/rg: organize and enhance the code of RunawayChecker (#55331)
JmPotato Aug 14, 2024
6499137
table: remove method `Txn()` in `MutateContext` (#55400)
lcwangchao Aug 14, 2024
1b172b6
sessionctx: fix a deadlock when set `tidb_restricted_read_only = true…
Defined2014 Aug 14, 2024
34d275d
planner: fix index merge typo (#55410)
AilinKid Aug 15, 2024
c74a233
planner: move logical union all to logicalop pkg. (#55402)
AilinKid Aug 15, 2024
fcff6e1
*: fix an unstable test case TestJoinSystemTableContainsView (#55431)
tiancaiamao Aug 15, 2024
281c758
ddl: move structs related to scheduler out from ddlCtx & add job cont…
D3Hunter Aug 15, 2024
881eedd
*: add extractor for cluster_tidb_index_usage (#55416)
joechenrh Aug 15, 2024
2045418
ddl: Global index more restrictions (#55440)
mjonss Aug 15, 2024
f73e3e3
ddl: clone table meta for recover table (#55443)
joechenrh Aug 16, 2024
0252698
*: upgrade linter revive (#55346)
hawkingrei Aug 16, 2024
4917ebb
pkg/metrics: improve the TiDB-Runtime->Memory Usage panel (#55391)
XuHuaiyu Aug 16, 2024
fe70f25
infoschema: let applyDropSchemaV2 return affected table IDs (#55445)
tiancaiamao Aug 16, 2024
f272707
*: support concurrent auto analyze (#54432)
hawkingrei Aug 16, 2024
6d403d4
*: fix flaky deadlock with go1.23 (#55479)
hawkingrei Aug 16, 2024
a8ddba1
expression: remove `SessionVarsPropReader` in `builtinGetParamStringS…
lcwangchao Aug 16, 2024
336d3a3
ranger: should replace ast.Or with ast.LogicalOr (#55476)
hawkingrei Aug 16, 2024
60b96b4
OWNERS: Auto Sync OWNERS files from community membership (#55485)
ti-chi-bot Aug 18, 2024
9e9e9c2
planner: export elements in cteClass for late pkg move. (#55429)
AilinKid Aug 19, 2024
061d865
planner: move logical expand into logicalop pkg. (#55428)
AilinKid Aug 19, 2024
7342d1d
planner: simplify datasource's pointer receiver member function. (#55…
AilinKid Aug 19, 2024
db54a3b
*: fix cannot get column info from generate column (#55447)
hawkingrei Aug 19, 2024
f751f73
*: use model.CIStr in infoschema v2 to handle case insensitive (#55450)
tiancaiamao Aug 19, 2024
45b127d
executor: add test for issue 55500 and it has been fixed by #53489 (#…
crazycs520 Aug 19, 2024
509d1bd
expression: `expression.BuildSimpleExpr` supports to build `ParamMark…
lcwangchao Aug 19, 2024
7ef2d46
table: Add `GetExchangePartitionDMLSupport` and remove `GetDomainInfo…
lcwangchao Aug 19, 2024
559f634
planner/core: pushdown TiFlash store type check to ColumnToProto (#55…
joechenrh Aug 19, 2024
e30408e
variable: mark analyze-partition-concurrency-quota as deprecated (#55…
Rustin170506 Aug 20, 2024
07f7d7b
executor: fix query hang when sorted column is constant (#55418)
xzhangxian1008 Aug 20, 2024
09b85fb
*: bump client-go to remove the backoff for stale read retry (#55423)
you06 Aug 20, 2024
f471302
br: Add pre-check of duplicate table in the downstream (#55044)
RidRisR Aug 20, 2024
8f75ed3
lightning: fix pd leader switch CI after PD upgrading (#55498)
lance6716 Aug 20, 2024
2621a4c
ddl: directly use BackendConfig rather than use lightning config (#55…
lance6716 Aug 20, 2024
ed9aa18
br: clean codes -- simplify the `CreateTable` stage (#55274)
Leavrth Aug 20, 2024
c1c74b1
server: wait for auto commit queries before shutdown (#55494)
YangKeao Aug 20, 2024
ba4064d
Merge remote-tracking branch 'origin/master' into wenxuan/vector-merg…
breezewish Aug 20, 2024
6d95459
ddl: fix resuming to wrong checkpoint when failed during adding index…
tangenta Aug 20, 2024
85235b3
domain: change groupSize in splitForConcurrentFetch (#55518)
joechenrh Aug 20, 2024
49828bd
infoschema: add WithRefillOption for TableByName and TableByID (#55511)
tiancaiamao Aug 20, 2024
adc7597
*: replace maps.Copy which is for map clone with std maps.Clone (#55530)
D3Hunter Aug 20, 2024
f2c278d
Planner: Do not allow cardinality to go below 1 (#55242)
terry1purcell Aug 20, 2024
cbdd12e
show: prefilter table name with like pattern and show full tables (#5…
GMHDBJD Aug 20, 2024
1f095a3
lighting: expose limited fields for `kv.Session` (#55517)
lcwangchao Aug 20, 2024
3464dae
parser: call `SetText` correctly for `CreateViewStmt` (#55520)
Defined2014 Aug 21, 2024
80d9f5f
Merge remote-tracking branch 'origin/master' into wenxuan/vector-merg…
breezewish Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
204 changes: 102 additions & 102 deletions DEPS.bzl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ bazel_coverage_test: failpoint-enable bazel_ci_simple_prepare
bazel_build:
mkdir -p bin
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \
//... --//build:with_nogo_flag=$(NOGO_FLAG)
//... --//build:with_nogo_flag=$(NOGO_FLAG) --subcommands
bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \
//cmd/importer:importer //cmd/tidb-server:tidb-server //cmd/tidb-server:tidb-server-check --//build:with_nogo_flag=$(NOGO_FLAG)
cp bazel-out/k8-fastbuild/bin/cmd/tidb-server/tidb-server_/tidb-server ./bin
Expand Down
2 changes: 1 addition & 1 deletion OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ approvers:
- guo-shaoge
- hanfei1991
- hawkingrei
- hi-rustin
- hicqu
- holys
- hongyunyan
Expand Down Expand Up @@ -80,6 +79,7 @@ approvers:
- qw4990
- rebelice
- Reminiscent
- Rustin170506
- sdojjy
- shenli
- siddontang
Expand Down
17 changes: 8 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ http_archive(

http_archive(
name = "bazel_features",
sha256 = "d7787da289a7fb497352211ad200ec9f698822a9e0757a4976fd9f713ff372b3",
strip_prefix = "bazel_features-1.9.1",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.9.1/bazel_features-v1.9.1.tar.gz",
sha256 = "ba1282c1aa1d1fffdcf994ab32131d7c7551a9bc960fbf05f42d55a1b930cbfb",
strip_prefix = "bazel_features-1.15.0",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.15.0/bazel_features-v1.15.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")
Expand Down Expand Up @@ -48,12 +48,11 @@ http_archive(

http_archive(
name = "bazel_gazelle",
sha256 = "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5",
sha256 = "8ad77552825b078a10ad960bec6ef77d2ff8ec70faef2fd038db713f410f5d87",
urls = [
"http://bazel-cache.pingcap.net:8080/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"http://ats.apps.svc/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"http://bazel-cache.pingcap.net:8080/bazelbuild/bazel-gazelle/releases/download/v0.38.0/bazel-gazelle-v0.38.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.38.0/bazel-gazelle-v0.38.0.tar.gz",
"http://ats.apps.svc/bazelbuild/bazel-gazelle/releases/download/v0.38.0/bazel-gazelle-v0.38.0.tar.gz",
],
)

Expand Down Expand Up @@ -86,7 +85,7 @@ go_download_sdk(
"https://mirrors.aliyun.com/golang/{}",
"https://dl.google.com/go/{}",
],
version = "1.21.12",
version = "1.21.13",
)

go_register_toolchains(
Expand Down
7 changes: 6 additions & 1 deletion br/cmd/br/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ go_library(
"//pkg/util",
"//pkg/util/gctuner",
"//pkg/util/logutil",
"//pkg/util/mathutil",
"//pkg/util/memory",
"//pkg/util/metricsutil",
"//pkg/util/redact",
"//pkg/util/size",
"@com_github_gogo_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
Expand All @@ -63,5 +65,8 @@ go_test(
srcs = ["main_test.go"],
embed = [":br_lib"],
flaky = True,
deps = ["@org_uber_go_goleak//:goleak"],
deps = [
"@com_github_stretchr_testify//require",
"@org_uber_go_goleak//:goleak",
],
)
52 changes: 52 additions & 0 deletions br/cmd/br/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ package main
import (
"context"
"fmt"
"math"
"os"
"path/filepath"
"runtime/debug"
"sync"
"sync/atomic"
"time"
Expand All @@ -21,9 +23,12 @@ import (
"github.com/pingcap/tidb/pkg/config"
tidbutils "github.com/pingcap/tidb/pkg/util"
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/pingcap/tidb/pkg/util/mathutil"
"github.com/pingcap/tidb/pkg/util/memory"
"github.com/pingcap/tidb/pkg/util/redact"
"github.com/pingcap/tidb/pkg/util/size"
"github.com/spf13/cobra"
"go.uber.org/zap"
)

var (
Expand Down Expand Up @@ -107,6 +112,25 @@ func AddFlags(cmd *cobra.Command) {
_ = cmd.PersistentFlags().MarkHidden(FlagRedactLog)
}

const quarterGiB uint64 = 256 * size.MB
const halfGiB uint64 = 512 * size.MB
const fourGiB uint64 = 4 * size.GB

func calculateMemoryLimit(memleft uint64) uint64 {
// memreserved = f(memleft) = 512MB * memleft / (memleft + 4GB)
// * f(0) = 0
// * f(4GB) = 256MB
// * f(+inf) -> 512MB
memreserved := halfGiB / (1 + fourGiB/(memleft|1))
// 0 memused memtotal-memreserved memtotal
// +--------+--------------------+----------------+
// ^ br mem upper limit
// +--------------------^
// GOMEMLIMIT range
memlimit := memleft - memreserved
return memlimit
}

// Init initializes BR cli.
func Init(cmd *cobra.Command) (err error) {
initOnce.Do(func() {
Expand Down Expand Up @@ -162,6 +186,34 @@ func Init(cmd *cobra.Command) (err error) {
}
log.ReplaceGlobals(lg, p)
memory.InitMemoryHook()
if debug.SetMemoryLimit(-1) == math.MaxInt64 {
memtotal, e := memory.MemTotal()
if e != nil {
err = e
return
}
memused, e := memory.MemUsed()
if e != nil {
err = e
return
}
if memused >= memtotal {
log.Warn("failed to obtain memory size, skip setting memory limit",
zap.Uint64("memused", memused), zap.Uint64("memtotal", memtotal))
} else {
memleft := memtotal - memused
memlimit := calculateMemoryLimit(memleft)
// BR command needs 256 MiB at least, if the left memory is less than 256 MiB,
// the memory limit cannot limit anyway and then finally OOM.
memlimit = mathutil.Max(memlimit, quarterGiB)
log.Info("calculate the rest memory",
zap.Uint64("memtotal", memtotal), zap.Uint64("memused", memused), zap.Uint64("memlimit", memlimit))
// No need to set memory limit because the left memory is sufficient.
if memlimit < uint64(math.MaxInt64) {
debug.SetMemoryLimit(int64(memlimit))
}
}
}

redactLog, e := cmd.Flags().GetBool(FlagRedactLog)
if e != nil {
Expand Down
16 changes: 16 additions & 0 deletions br/cmd/br/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/require"
"go.uber.org/goleak"
)

Expand Down Expand Up @@ -75,3 +76,18 @@ func TestRunMain(*testing.T) {

<-waitCh
}

func TestCalculateMemoryLimit(t *testing.T) {
// f(0 Byte) = 0 Byte
require.Equal(t, uint64(0), calculateMemoryLimit(0))
// f(100 KB) = 87.5 KB
require.Equal(t, uint64(89600), calculateMemoryLimit(100*1024))
// f(100 MB) = 87.5 MB
require.Equal(t, uint64(91763188), calculateMemoryLimit(100*1024*1024))
// f(3.99 GB) = 3.74 GB
require.Equal(t, uint64(4026531839), calculateMemoryLimit(4*1024*1024*1024-1))
// f(4 GB) = 3.5 GB
require.Equal(t, uint64(3758096384), calculateMemoryLimit(4*1024*1024*1024))
// f(32 GB) = 31.5 GB
require.Equal(t, uint64(33822867456), calculateMemoryLimit(32*1024*1024*1024))
}
4 changes: 3 additions & 1 deletion br/pkg/backup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ go_test(
"client_test.go",
"main_test.go",
"schema_test.go",
"store_test.go",
],
embed = [":backup"],
flaky = True,
race = "on",
shard_count = 12,
shard_count = 14,
deps = [
"//br/pkg/conn",
"//br/pkg/gluetidb/mock",
Expand All @@ -92,6 +93,7 @@ go_test(
"@com_github_tikv_client_go_v2//testutils",
"@com_github_tikv_pd_client//:client",
"@io_opencensus_go//stats/view",
"@org_golang_google_grpc//:grpc",
"@org_uber_go_goleak//:goleak",
],
)
4 changes: 2 additions & 2 deletions br/pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,9 +1233,9 @@ func (bc *Client) OnBackupResponse(
return txnlock.NewLock(lockErr), nil
}
}
res := errContext.HandleIgnorableError(errPb, storeID)
res := utils.HandleBackupError(errPb, storeID, errContext)
switch res.Strategy {
case utils.GiveUpStrategy:
case utils.StrategyGiveUp:
errMsg := res.Reason
if len(errMsg) <= 0 {
errMsg = errPb.Msg
Expand Down
65 changes: 64 additions & 1 deletion br/pkg/backup/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"io"
"os"
"sync"
"time"

"github.com/pingcap/errors"
Expand Down Expand Up @@ -57,12 +58,73 @@ func (r ResponseAndStore) GetStoreID() uint64 {
return r.StoreID
}

// timeoutRecv cancel the context if `Refresh()` is not called within the specified time `timeout`.
type timeoutRecv struct {
wg sync.WaitGroup
parentCtx context.Context
cancel context.CancelCauseFunc

refresh chan struct{}
}

// Refresh the timeout ticker
func (trecv *timeoutRecv) Refresh() {
select {
case <-trecv.parentCtx.Done():
case trecv.refresh <- struct{}{}:
}
}

// Stop the timeout ticker
func (trecv *timeoutRecv) Stop() {
close(trecv.refresh)
trecv.wg.Wait()
}

var TimeoutOneResponse = time.Hour

func (trecv *timeoutRecv) loop(timeout time.Duration) {
defer trecv.wg.Done()
ticker := time.NewTicker(timeout)
defer ticker.Stop()
for {
ticker.Reset(timeout)
select {
case <-trecv.parentCtx.Done():
return
case _, ok := <-trecv.refresh:
if !ok {
return
}
case <-ticker.C:
log.Warn("receive a backup response timeout")
trecv.cancel(errors.Errorf("receive a backup response timeout"))
}
}
}

func StartTimeoutRecv(ctx context.Context, timeout time.Duration) (context.Context, *timeoutRecv) {
cctx, cancel := context.WithCancelCause(ctx)
trecv := &timeoutRecv{
parentCtx: ctx,
cancel: cancel,
refresh: make(chan struct{}),
}
trecv.wg.Add(1)
go trecv.loop(timeout)
return cctx, trecv
}

func doSendBackup(
ctx context.Context,
pctx context.Context,
client backuppb.BackupClient,
req backuppb.BackupRequest,
respFn func(*backuppb.BackupResponse) error,
) error {
// Backup might be stuck on GRPC `waitonHeader`, so start a timeout ticker to
// terminate the backup if it does not receive any new response for a long time.
ctx, timerecv := StartTimeoutRecv(pctx, TimeoutOneResponse)
defer timerecv.Stop()
failpoint.Inject("hint-backup-start", func(v failpoint.Value) {
logutil.CL(ctx).Info("failpoint hint-backup-start injected, " +
"process will notify the shell.")
Expand Down Expand Up @@ -107,6 +169,7 @@ func doSendBackup(

for {
resp, err := bCli.Recv()
timerecv.Refresh()
if err != nil {
if errors.Cause(err) == io.EOF { // nolint:errorlint
logutil.CL(ctx).Debug("backup streaming finish",
Expand Down
Loading