tikv / tikv/pd

allocate unique tso in different cluster.

Open
#10,427 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Enhancement Task
Background

Previously, PD maintained both local TSO and global TSO allocation logic. Recently this logic has been removed/simplified.

However, in some multi-cluster scenarios we still need a way to ensure TSO uniqueness across clusters.

Proposal

We can leverage the existing suffix bits mechanism to differentiate TSO values generated by different clusters.

For example:
• Cluster A: configure tsoSuffix = 0
• Cluster B: configure tsoSuffix = 1

With the suffix bits embedded into the TSO, each cluster will generate timestamps with different suffix values. This guarantees that TSOs produced by different clusters will never collide, even if the physical/logical parts overlap.

Benefits
• Ensures global uniqueness of TSO across clusters
• Reuses the existing suffix bits mechanism
• Avoids reintroducing complex local/global TSO allocation logic
• Keeps PD implementation simple

Example

```
Cluster A TSO: physical | logical | suffix=0
Cluster B TSO: physical | logical | suffix=1
```

Thus, TSOs from different clusters remain unique.

Use Case

This is useful in scenarios such as:
• multi-cluster deployments
• cross-cluster data synchronization
• globally unique transaction ordering

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.