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

Make the Local TSO Allocators in the same DC to start the election first #3963

Closed
JmPotato opened this issue Aug 11, 2021 · 1 comment
Closed
Labels
component/tso Timestamp Oracle. type/enhancement The issue or PR belongs to an enhancement.

Comments

@JmPotato
Copy link
Member

JmPotato commented Aug 11, 2021

Feature Request

Describe your feature request related problem

For now, we use (*AllocatorManager).PriorityChecker() to make sure a Local TSO Allocator is elected from the corresponding DC as possible. However, when a new cluster is started or some PD instances in the same DC are joined, there is the possibility that the Local TSO Allocator is played by a PD node from another DC. That's because the priority is guaranteed by PriorityChecker to check periodically whether the current Local TSO Allocator is from its DC correctly, which has some lagging depending on the inspection period.

// PriorityChecker is used to check the election priority of a Local TSO Allocator.
// In the normal case, if we want to elect a Local TSO Allocator for a certain DC,
// such as dc-1, we need to make sure the follow priority rules:
// 1. The PD server with dc-location="dc-1" needs to be elected as the allocator
// leader with the highest priority.
// 2. If all PD servers with dc-location="dc-1" are down, then the other PD servers
// of DC could be elected.
func (am *AllocatorManager) PriorityChecker() {

Describe the feature you'd like

We need to make sure the PD nodes from the corresponding DC become its Local TSO Allocator as soon as possible rather than being corrected by the PriorityChecker later, which should make the cluster provide more stable and fast TSO service to TiDB.

Describe alternatives you've considered

Maybe we can trigger a DC's Local TSO Allocator election earlier than other PD nodes in the other DCs.

@JmPotato JmPotato added type/enhancement The issue or PR belongs to an enhancement. component/tso Timestamp Oracle. labels Aug 11, 2021
@okJiang
Copy link
Member

okJiang commented Aug 7, 2024

/close ref #2759 (comment)

@JmPotato JmPotato closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tso Timestamp Oracle. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants