Skip to content

Rewind after region cache GC reaches the end#678

Merged
sticnarf merged 1 commit intotikv:masterfrom
sticnarf:bg-clean-cache
Jan 30, 2023
Merged

Rewind after region cache GC reaches the end#678
sticnarf merged 1 commit intotikv:masterfrom
sticnarf:bg-clean-cache

Conversation

@sticnarf
Copy link
Collaborator

#664 was incomplete. The searching cursor increases monotonically without rewinding. So, if the regions split after the cursor passes their start keys, they will not be cleared after being stale.

This PR rewinds the cursor after reaching the end.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf sticnarf requested a review from ekexium January 30, 2023 07:22
@sticnarf sticnarf merged commit 78470ad into tikv:master Jan 30, 2023
sticnarf added a commit to sticnarf/client-go that referenced this pull request Jan 30, 2023
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
sticnarf added a commit to sticnarf/client-go that referenced this pull request Jan 31, 2023
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
sticnarf added a commit to sticnarf/client-go that referenced this pull request Jan 31, 2023
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
disksing pushed a commit that referenced this pull request Jan 31, 2023
* RuntimeStat: Clone `SnapshotRuntimeStats` Completely (#641) * add more info for cloning SnapshotRuntimeStats Signed-off-by: TonsnakeLin <lpbgytong@163.com> * add more info for cloning SnapshotRuntimeStats Signed-off-by: TonsnakeLin <lpbgytong@163.com> * shallow copy SnapshotRuntimeStats Signed-off-by: TonsnakeLin <lpbgytong@163.com> Signed-off-by: TonsnakeLin <lpbgytong@163.com> Co-authored-by: Yilin Chen <sticnarf@gmail.com> * fix data race in the LockKeys (#655) Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com> * Add a background region cache GC goroutine (#664) Signed-off-by: Yilin Chen <sticnarf@gmail.com> * Rewind after cacheGC reaches the end (#678) Signed-off-by: Yilin Chen <sticnarf@gmail.com> --------- Signed-off-by: TonsnakeLin <lpbgytong@163.com> Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com> Signed-off-by: Yilin Chen <sticnarf@gmail.com> Co-authored-by: TonsnakeLin <87681388+TonsnakeLin@users.noreply.github.com> Co-authored-by: Weizhen Wang <wangweizhen@pingcap.com>
disksing pushed a commit that referenced this pull request Jan 31, 2023
* Add a background region cache GC goroutine (#664) * Add a background region cache GC goroutine Signed-off-by: Yilin Chen <sticnarf@gmail.com> * Change interval to 1s and regionPerRound to 50 Signed-off-by: Yilin Chen <sticnarf@gmail.com> * Rewind after cacheGC reaches the end (#678) Signed-off-by: Yilin Chen <sticnarf@gmail.com> --------- Signed-off-by: Yilin Chen <sticnarf@gmail.com>
disksing pushed a commit that referenced this pull request Jan 31, 2023
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants