Address the compatibility issue with hibernate region #657
Labels
component/kv-client
TiKV kv log client component.
component/tikv
TiKV component.
difficulty/hard
Hard task.
priority/P0
The issue has P0 priority.
type/bugfix
This PR fixes a bug.
Milestone
Known issues (2022 Q1)
Feature Request
Is your feature request related to a problem? Please describe:
Background
Hibernate Region is a feature for Raft. It stops to send heartbeats after a Raft group have not received proposals for a while. (see more details in 2019-03-04-hibernate-raft.md)
And in TiCDC, it needs a timestamp (called
resolvedTS
) in which we can ensure all transactions which start before this timestamp have completed and been sent from TiKV to TiCDC. TiKV advances by tracking the locks which haven't been clean, and getting a tso from pd periodically (1s by default), and the maximum timestamp among the start ts for the locks and the tso isregion resolvedTS
. TiCDC uses the maximum timestamp amongregion resolvedTS
s asglobal resolvedTS
.Problem
As was shown above, it's easy to know the
region resolvedTS
is ought to be advanced by the leader of a Raft group. We must check the leadership before advancing theregion resolvedTS
, so that Hibernate Region was broken since we cannot know whether a peer is a leader without sending a heartbeat after the lease was expired.TODO list
The key is majority, we can check the majority (or leadership) at the client-side (in this context client means TiCDC). In this way, we avoid to send a heartbeat inside the Raft group, then it will not break Hibernate Region.
Teachability, Documentation, Adoption, Migration Strategy:
TODO
Value
Value description
Very important in large scale cluster
Value score
Workload estimation
Time
GanttStart: 2020-09-01
GanttDue: 2020-10-30
GanttProgress: 60%
The text was updated successfully, but these errors were encountered: