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

Support multi-keyspace-group and sharding in tso grpc service #6232

Closed
13 tasks done
binshi-bing opened this issue Mar 27, 2023 · 1 comment
Closed
13 tasks done

Support multi-keyspace-group and sharding in tso grpc service #6232

binshi-bing opened this issue Mar 27, 2023 · 1 comment
Assignees
Labels
type/development The issue belongs to a development tasks

Comments

@binshi-bing binshi-bing added the type/development The issue belongs to a development tasks label Mar 27, 2023
@binshi-bing binshi-bing changed the title Support multiple keyspace groups and sharding in TSO Support multiple keyspace groups and sharding in TSO grpc service Mar 27, 2023
@binshi-bing binshi-bing changed the title Support multiple keyspace groups and sharding in TSO grpc service Support multiple keyspace groups and sharding in tso grpc service Mar 27, 2023
@binshi-bing binshi-bing changed the title Support multiple keyspace groups and sharding in tso grpc service Support multi-keyspace-group and sharding in tso grpc service Mar 27, 2023
ti-chi-bot pushed a commit that referenced this issue Apr 6, 2023
…membership/distribution change (#6247)

ref #6232

Load initial keyspace group assignment.
Dynamically watch/apply keyspace groups' membership/distribution change.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
ti-chi-bot pushed a commit that referenced this issue Apr 7, 2023
…ps assignment (#6280)

ref #6232

Add more failure tests when tso service loading initial keyspace groups assignment

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
ti-chi-bot pushed a commit that referenced this issue Apr 11, 2023
…sistency issue (#6282)

ref #6232

Apply multi-keyspace-group membership to tso service and handle inconsistency issue.

1. Add KeyspaceLookupTable to endpoint.KeyspaceGroup
type KeyspaceGroup struct {
        ...
        // KeyspaceLookupTable is for fast lookup if a given keyspace belongs to this keyspace group.
        // It's not persisted and will be built when loading from storage.
        KeyspaceLookupTable map[uint32]struct{} `json:"-"`
}

2. After loading keyspace groups, the Keyspace Group Manager builds KeyspaceLookupTable for every keyspace groups.

3. When Keyspace Group Manager handles tso requests, it uses the keyspaceLookupTable to check if the required keypsace still belongs to the required keyspace group. If not, returns the current keyspace group id in the tso response header.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
ti-chi-bot added a commit that referenced this issue Apr 11, 2023
ref #6232

Support the keyspace group split and add related tests.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit that referenced this issue Apr 12, 2023
ref #6232

Use the RWMutex instead of individual atomic types to better protect the state of the keyspace group manager

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
ti-chi-bot added a commit that referenced this issue Apr 12, 2023
ref #6232

Add `split-from` field for `endpoint.KeyspaceGroup`.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
ti-chi-bot added a commit that referenced this issue Apr 12, 2023
ref #6232, ref #6305

follow-up #6305 
Add read lock at one place for protection and better structure

Signed-off-by: Bin Shi <binshi.bing@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit that referenced this issue Apr 13, 2023
ref #6232

Optimize function signatures to reduce parameter passing.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
ti-chi-bot pushed a commit that referenced this issue Apr 13, 2023
ref #6232

Prevent keyspace from being updated during the split.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 8, 2023
ref tikv#6232

Enable `TestTSOKeyspaceGroupSplitClient`.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 8, 2023
…6397)

ref tikv#6232

Fix the keyspace assignment patrol consistency.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 8, 2023
ref tikv#6232

Patrol the keyspace assignment in batch.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 8, 2023
…nfo (tikv#6373)

ref tikv#6232

Add API interface to obtain the TSO keyspace group member info.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this issue May 10, 2023
ref #6232

Add the keyspace group commands to show and split keyspace groups.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 10, 2023
ref tikv#6232

Enable `TestTSOKeyspaceGroupSplitClient`.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 10, 2023
…6397)

ref tikv#6232

Fix the keyspace assignment patrol consistency.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 10, 2023
ref tikv#6232

Patrol the keyspace assignment in batch.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 10, 2023
…nfo (tikv#6373)

ref tikv#6232

Add API interface to obtain the TSO keyspace group member info.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
zeminzhou pushed a commit to zeminzhou/pd that referenced this issue May 10, 2023
ref tikv#6232

Add the keyspace group commands to show and split keyspace groups.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
ti-chi-bot bot added a commit that referenced this issue Jun 21, 2023
ref #6232

Fix `checkTSOSplit` to finish split correctly.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit that referenced this issue Jun 25, 2023
… range (#6646)

ref #6232

Support to split keyspace group with the keyspace ID range.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Add more TSO split tests.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
…ikv#6353)

ref tikv#6232

The next revision to watch should always be Header.Revision + 1 where header is response header of watch/Get/RangeScan

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
…2E path (tikv#6321)

ref tikv#6232

Support multi-keyspace-group in PD(TSO) client

Signed-off-by: Bin Shi <binshi.bing@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

fix bugs to make split test case to pass

Signed-off-by: Bin Shi <binshi.bing@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Patrol the keyspace assignment before the first split to make sure every keyspace has its group assignment.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Enable `TestTSOKeyspaceGroupSplitClient`.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx added a commit to rleungx/pd that referenced this issue Aug 2, 2023
…6397)

ref tikv#6232

Fix the keyspace assignment patrol consistency.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Patrol the keyspace assignment in batch.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
…nfo (tikv#6373)

ref tikv#6232

Add API interface to obtain the TSO keyspace group member info.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Add the keyspace group commands to show and split keyspace groups.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Fix `checkTSOSplit` to finish split correctly.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
… range (tikv#6646)

ref tikv#6232

Support to split keyspace group with the keyspace ID range.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
ref tikv#6232

Fix `checkTSOSplit` to finish split correctly.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
rleungx pushed a commit to rleungx/pd that referenced this issue Aug 2, 2023
… range (tikv#6646)

ref tikv#6232

Support to split keyspace group with the keyspace ID range.

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/development The issue belongs to a development tasks
Projects
None yet
Development

No branches or pull requests

4 participants