Commit Graph

492 Commits

Author SHA1 Message Date
MyonKeminta c0cf773917
Fix the issue that primary pessimistic lock may be left not cleared after GC (#866)
* Fix the issue that primary pessimistic lock may be left not cleared after GC

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Fix mysteriously shown up thing that makes compilation failed

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Fix test effectiveness (forgot to set txn2 to pessimistic txn); add more strict checks

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Address comments

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-07-04 15:17:05 +08:00
crazycs fbec023060
*: refine non-global stale-read request retry logic (#863)
Signed-off-by: crazycs520 <crazycs520@gmail.com>
2023-07-03 12:12:02 +08:00
王超 c764d7bc8f
client-go: add some key range info to error when PD returned no region (#862)
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
2023-06-30 14:27:00 +08:00
zyguan 04dc78e522
lock_resolver: let getTxnStatusFromLock return error when backoff timeout (#847)
Signed-off-by: zyguan <zhongyangguan@gmail.com>
Co-authored-by: disksing <i@disksing.com>
2023-06-21 13:07:44 +08:00
glorv 864a5fc0c4
make ResourceControlInterceptor atomic (#848)
Signed-off-by: glorv <glorvs@163.com>
2023-06-21 11:10:26 +08:00
glorv 18b17d4b72
fix rpc interceptor data race (#845)
Signed-off-by: glorv <glorvs@163.com>
2023-06-18 22:18:18 -07:00
Yongbo Jiang b32f340d06
impl resource manager get default resource group (#839)
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
2023-06-15 09:18:45 -07:00
glorv 0b4b0ca00e
kvrpc: deduplicate chained intercept by name (#832)
* dedup chained interceptor

Signed-off-by: glorv <glorvs@163.com>
2023-06-13 20:21:06 -07:00
crazycs df58452fe1
client_batch: add test for auto re-connect idle connection when wait connection ready and fix ci (#835)
* client_batch: add test

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix ci

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix ci

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix ci

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* update go version

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix ci

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix ci lint

Signed-off-by: crazycs520 <crazycs520@gmail.com>

* fix ci lint

Signed-off-by: crazycs520 <crazycs520@gmail.com>

---------

Signed-off-by: crazycs520 <crazycs520@gmail.com>
2023-06-13 14:17:17 +08:00
Yongbo Jiang 5ddc523cfc
*: update pd client version (#830)
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
2023-06-08 15:47:29 +08:00
zzm cf07be2ba0
add const label for metrics (#802)
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Co-authored-by: disksing <i@disksing.com>
2023-06-07 13:48:17 +08:00
Hu# 28247160f4
PDHTTPClient: when meet GetStoreMinResolvedTS error just write in debug log (#825)
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Co-authored-by: disksing <i@disksing.com>
2023-06-05 16:51:12 +08:00
ShuNing 27d0c27915
controller: add replica number (#823)
Signed-off-by: nolouch <nolouch@gmail.com>
2023-06-01 14:52:28 +08:00
you06 11121c6913
Remove stale-read flag after resolving lock (#792)
* remove stale-read when key-is-locked

Signed-off-by: you06 <you1474600@gmail.com>

* disable follower read for batch get

Signed-off-by: you06 <you1474600@gmail.com>

* the stale-read flag may already set to false

Signed-off-by: you06 <you1474600@gmail.com>

* fix batchget

Signed-off-by: you06 <you1474600@gmail.com>

* Reset busy-threshold when stale read fallback to leader read

Signed-off-by: you06 <you1474600@gmail.com>

* address comment

Signed-off-by: you06 <you1474600@gmail.com>

* trigger CI

Signed-off-by: you06 <you1474600@gmail.com>

---------

Signed-off-by: you06 <you1474600@gmail.com>
2023-05-26 13:55:53 +08:00
Weizhen Wang d3c53d30ff
update dependency (#816)
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
2023-05-24 15:32:22 +08:00
Hu# 1b28766936
PDHTTPClient: when meet GetStoreMinResolvedTS error just write in debug log (#814)
Signed-off-by: husharp <ihusharp@gmail.com>
2023-05-24 11:26:53 +08:00
David 893dd82957
[CodecV2] cache keyspaceID when creating codecV2 (#812) 2023-05-23 15:31:32 +08:00
MyonKeminta d1e188a981
Do not skip TestBatchResolveLocks for unistore (#807)
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-05-18 19:48:00 +08:00
Hu# adb48afeef
pd http: support api to get store min resolved ts (#793)
Signed-off-by: husharp <ihusharp@gmail.com>
2023-05-12 11:43:16 +08:00
you06 c946782286
Fallback to leader read when replica read meets flashback-in-progress error (#796)
* handle flashback error when follower read

Signed-off-by: you06 <you1474600@gmail.com>

* add test

Signed-off-by: you06 <you1474600@gmail.com>

* trigger CI

Signed-off-by: you06 <you1474600@gmail.com>

* fix panic

Signed-off-by: you06 <you1474600@gmail.com>

* trigger CI

Signed-off-by: you06 <you1474600@gmail.com>

* trigger CI

Signed-off-by: you06 <you1474600@gmail.com>

---------

Signed-off-by: you06 <you1474600@gmail.com>
2023-05-11 13:49:08 +08:00
zyguan 2b0667c65c
lock_resolver: handle pessimistic locks in BatchResolveLocks (#794)
* lock_resolver: handle pessimistic locks in BatchResolveLocks

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Add test but failed on unistore because unistore's ScanLock doesnt return lock type

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Address comments

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Fix test

Signed-off-by: zyguan <zhongyangguan@gmail.com>

* Fix golangci

Signed-off-by: zyguan <zhongyangguan@gmail.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: zyguan <zhongyangguan@gmail.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-05-11 12:26:01 +08:00
MyonKeminta 5c324b7c1e
lock_resolver: support verifying primary for check_txn_status (#777)
* support verifying primary for check_txn_status

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update kvproto

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* add more failpoint usages

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update depencency and fix test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Do not skip for unistore; refine logs

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Address comments

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-05-08 16:18:26 +08:00
Connor 62cc95123c
Fix wrong resource group name for some requests (#788)
* fix wrong resource group name

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
2023-04-28 19:03:56 +08:00
Hu# 069dbc5b6c
fix TestRURuntimeStatsCleanUp (#787)
Signed-off-by: husharp <ihusharp@gmail.com>
2023-04-28 13:43:54 +08:00
iosmanthus 36826f75ce
[master] encode store batch tasks (#786) 2023-04-27 19:54:53 +08:00
disksing aee2f311a5
txn: fix goroutine leak (#784)
Signed-off-by: disksing <i@disksing.com>
2023-04-27 17:39:07 +08:00
you06 c619a50474
add metrics for stale-read traffic (#776)
Signed-off-by: you06 <you1474600@gmail.com>
2023-04-27 14:55:46 +08:00
Smilencer f64d5dd79b
update dco (#731)
Signed-off-by: Smityz <smityz@qq.com>
Co-authored-by: disksing <i@disksing.com>
2023-04-27 14:45:04 +08:00
Violin 44663b372a
doc(tikv/test_probe.go) fix case typo in comment. (#778)
Signed-off-by: Violin0622 <violin0622@outlook.com>
2023-04-26 15:50:49 +08:00
MyonKeminta 2be71b35ee
Add afterSendReqToRegion failpoint (#780)
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-04-26 15:50:11 +08:00
Connor 35c1ee47c4
Set resource group penalty (#772)
* Set resource group penalty 

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
2023-04-19 20:39:20 +08:00
ekexium a72e61dc64
log: print log if the assertion error is generated from client-go (#771)
Signed-off-by: ekexium <eke@fastmail.com>
Co-authored-by: disksing <i@disksing.com>
2023-04-19 17:42:17 +08:00
ShuNing dd6caa4c03
execdetails: add RRU/WRU interface of RURuntimeStats (#769)
Signed-off-by: nolouch <nolouch@gmail.com>
2023-04-19 16:57:01 +08:00
Artem Danilov 415713766f
avoid dataIsNotReady error while retrying stale read on the leader (#765)
* avoid dataIsNotReady error while retrying stale read on the leader

Signed-off-by: artem_danilov <artem_danilov@airbnb.com>

* move StaleRead flag reset to retry section

Signed-off-by: artem_danilov <artem_danilov@airbnb.com>

* move all logic to #next and allow retry on the leader

Signed-off-by: artem_danilov <artem_danilov@airbnb.com>

---------

Signed-off-by: artem_danilov <artem_danilov@airbnb.com>
Co-authored-by: artem_danilov <artem_danilov@airbnb.com>
2023-04-19 10:48:52 +08:00
MyonKeminta 92db9f7b15
Support specifying checking forUpdateTS in prewrite (#756)
* Support specifying checking forUpdateTS in prewrite

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Fix go mod in tests

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Add test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Fix test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Add successful cases to the test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Fix test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Update dependencies

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Check LockedWithConflictTS greater than requested ForUpdateTS

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-04-17 14:53:28 +08:00
Jack Yu c853ddc68c
metrics: add txn ttl lifetime (#766)
Signed-off-by: Jack Yu <jackysp@gmail.com>
Co-authored-by: Shirly <AndreMouche@126.com>
2023-04-14 13:59:29 +08:00
ekexium 67e56a956f
For KeyIsLocked error reported for timeout, if a lock is recently updated, don't try to resolve it. (#758)
* update client-go; format

Signed-off-by: ekexium <eke@fastmail.com>

* feat: do not resolve lock if duration_to_last_updated is short

Signed-off-by: ekexium <eke@fastmail.com>

* adjust the threshold to 1200ms to allow small deviation

Signed-off-by: ekexium <eke@fastmail.com>

* fix: don't treat it as WriteConflict, simply retry

Signed-off-by: ekexium <eke@fastmail.com>

* update kvproto

Signed-off-by: ekexium <eke@fastmail.com>

* set the threshold to 300ms

Signed-off-by: ekexium <eke@fastmail.com>

---------

Signed-off-by: ekexium <eke@fastmail.com>
2023-04-13 16:14:28 +08:00
ekexium f3e87039d8
Finer `is_retry_request` settings (#763)
* set is_retry_request only for requests that is possible to have undetermined errors

Signed-off-by: ekexium <eke@fastmail.com>

* rename tryTimes to retryTimes

Signed-off-by: ekexium <eke@fastmail.com>

---------

Signed-off-by: ekexium <eke@fastmail.com>
Co-authored-by: cfzjywxk <lsswxrxr@163.com>
2023-04-10 10:39:43 +08:00
Lloyd-Pottiger 1ec0ff5bf4
Support return TiFlash system table by grpc (#759)
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
2023-04-06 14:42:57 +08:00
iosmanthus 4ac424aea1
refactor decoding buckets with new interface method: DecodeBucketKeys (#760)
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
2023-03-31 16:06:44 +08:00
iosmanthus 6a92aeec92
fix api v2 decode of region bucket's keys (#757)
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
2023-03-31 11:07:45 +08:00
Ryan Leung fd1b0552eb
upgrade pd client (#755)
Signed-off-by: Ryan Leung <rleungx@gmail.com>
2023-03-30 14:55:23 +08:00
MyonKeminta ea13e97002
Add exitAggressiveLockingIfInapplicable function and call within mutex of lockKeys (#749)
* Add exitAggressiveLockingIfInapplicable function and call within mutex of lockKeys

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* fix fmt

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Add test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
2023-03-28 16:41:04 +08:00
Smilencer bb350d6ea8
fix data race (#736)
Signed-off-by: Smityz <smityz@qq.com>
Co-authored-by: disksing <i@disksing.com>
2023-03-27 16:10:11 +08:00
Daniël van Eeden f7e35b25be
Log request info for label warning (#744)
Signed-off-by: Daniël van Eeden <git@myname.nl>
Co-authored-by: disksing <i@disksing.com>
2023-03-27 14:51:16 +08:00
Hu# f23d942527
gomod: update pd client (#743)
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Co-authored-by: disksing <i@disksing.com>
2023-03-27 14:37:08 +08:00
cfzjywxk 4f59f92a24
fix the incorrect txn size metric usages (#746)
Signed-off-by: cfzjywxk <lsswxrxr@163.com>
2023-03-27 13:58:40 +08:00
iosmanthus 2e8d7a2d8c
refine keyspace request encoding (#742) 2023-03-21 16:14:47 +08:00
you06 884a634378
compatible batch copr with load-based replica read (#739)
* compatible batch copr with load-based replica read

Signed-off-by: you06 <you1474600@gmail.com>

* handle batch cop when server is busy

Signed-off-by: you06 <you1474600@gmail.com>

debug

Signed-off-by: you06 <you1474600@gmail.com>

debug

Signed-off-by: you06 <you1474600@gmail.com>

debug

Signed-off-by: you06 <you1474600@gmail.com>

remove debug

Signed-off-by: you06 <you1474600@gmail.com>

* address comment

Signed-off-by: you06 <you1474600@gmail.com>

* ci

Signed-off-by: you06 <you1474600@gmail.com>

* ci

Signed-off-by: you06 <you1474600@gmail.com>

---------

Signed-off-by: you06 <you1474600@gmail.com>
2023-03-17 11:26:22 +08:00
BornChanger d19741b3ed
internal: treat default resource group normally (#708)
Signed-off-by: BornChanger <dawn_catcher@126.com>
2023-03-16 16:06:03 +08:00