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

Address the compatibility issue with hibernate region #657

Open
2 tasks done
5kbpers opened this issue Jun 15, 2020 · 3 comments · Fixed by tikv/tikv#8907
Open
2 tasks done

Address the compatibility issue with hibernate region #657

5kbpers opened this issue Jun 15, 2020 · 3 comments · Fixed by tikv/tikv#8907
Assignees
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

Comments

@5kbpers
Copy link
Contributor

5kbpers commented Jun 15, 2020

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 is region resolvedTS. TiCDC uses the maximum timestamp among region resolvedTSs as global 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 the region 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

  • In Raft, a peer is a leader means this peer was accepted by the majority of the peers in the Raft group.
    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

  • (TBD) / 5

Workload estimation

  • (TBD) 60 person-day

Time

GanttStart: 2020-09-01
GanttDue: 2020-10-30
GanttProgress: 60%

@5kbpers 5kbpers added component/kv-client TiKV kv log client component. component/tikv TiKV component. priority/P1 The issue has P1 priority. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jun 15, 2020
@5kbpers 5kbpers changed the title Compatible with hibernate region New mechanism for ResolvedTS Jun 15, 2020
@amyangfei amyangfei added priority/P0 The issue has P0 priority. and removed priority/P1 The issue has P1 priority. labels Jun 23, 2020
@amyangfei amyangfei added this to the v5.0.0 milestone Jun 23, 2020
@amyangfei amyangfei added status/WIP and removed help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jun 24, 2020
@5kbpers 5kbpers changed the title New mechanism for ResolvedTS Address the compatibility issue with hibernate region Jul 16, 2020
@scsldb scsldb added the type/bugfix This PR fixes a bug. label Jul 16, 2020
@amyangfei amyangfei added the difficulty/hard Hard task. label Jul 29, 2020
@scsldb scsldb modified the milestones: v5.0.0-alpha, v4.0.10 Oct 20, 2020
@5kbpers
Copy link
Contributor Author

5kbpers commented Dec 3, 2020

tikv/tikv#8907 This PR introduces an item cdc.hibernate-regions-compatible to tikv config.
After it gets merged, need to add a config checker to tiup and other deployment tools for raftstore.hibernate-regions and cdc.hibernate-regions-compatible

cc @BusyJay

@zhangjinpeng87
Copy link
Contributor

zhangjinpeng87 commented Dec 4, 2020

tikv/tikv#8907 This PR introduces an item cdc.hibernate-regions-compatible to tikv config.
After it gets merged, need to add a config checker to tiup and other deployment tools for raftstore.hibernate-regions and cdc.hibernate-regions-compatible

cc @BusyJay

@5kbpers Why need a new config? Adding config should be careful.

@5kbpers
Copy link
Contributor Author

5kbpers commented Apr 7, 2021

Pending PR tikv/tikv#9973, merge it after we confirmed this feature is stable in 5.0.

@overvenus overvenus assigned hicqu and unassigned 5kbpers Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants