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

tikv/safeTS: obtain min-resolved-ts by store list #921

Merged
merged 18 commits into from
Sep 5, 2023

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Aug 2, 2023

close #922

Background

Nowadays we have 2 api interface for obtaining min resolved ts

  • /pd/api/v1/min-resolved-ts: obtain cluster's min resolved ts
  • /pd/api/v1/min-resolved-ts/{store_id}: obtain each store's min resolved ts

There are 2 repair step in this pr:

  1. We can use the approach I to get cluster's min resolved ts when @@txn_scope is global.
  2. For client-go's updateSafeTS, we call approach II for each store, which is not necessary.
    We can extend the approach I params to obtain specified store via a list to reduce the cost per call after api: Extend the min-resolved-ts api to support getting the specified store  pd#6880 merged

Summary pr

step 1

judge @@txn_scope value which from the config:

  • when find is global, we can get cluster-level resolved ts.
  • when find is not global, we need to extend approach II.

step 2

use approach I's extension to get all stores.

@HuSharp
Copy link
Member Author

HuSharp commented Aug 2, 2023

@JmPotato @lhy1024 PTAL as well, thx!

integration_tests/go.mod Outdated Show resolved Hide resolved
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 46d5ceb to 681f10d Compare August 2, 2023 07:13
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 681f10d to c5bf330 Compare August 2, 2023 07:14
tikv/kv.go Outdated Show resolved Hide resolved
tikv/kv.go Outdated Show resolved Hide resolved
tikv/kv.go Outdated Show resolved Hide resolved
tikv/kv.go Outdated Show resolved Hide resolved
Signed-off-by: husharp <jinhao.hu@pingcap.com>
.github/workflows/integration.yml Outdated Show resolved Hide resolved
tikv/kv.go Outdated Show resolved Hide resolved
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 9b56a52 to 785d22e Compare August 2, 2023 10:05
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 4a3253a to 3f36b93 Compare August 9, 2023 02:29
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp
Copy link
Member Author

HuSharp commented Aug 14, 2023

@nolouch PTAL, thx!

@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch 3 times, most recently from a376cf3 to 9bd870e Compare August 14, 2023 06:04
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 9bd870e to b771e63 Compare August 14, 2023 06:25
@HuSharp
Copy link
Member Author

HuSharp commented Aug 16, 2023

friendly ping :) @JmPotato @nolouch

tikv/kv.go Outdated Show resolved Hide resolved
tikv/kv.go Outdated Show resolved Hide resolved
util/pd.go Outdated Show resolved Hide resolved
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 2a603e8 to 6e0f17d Compare September 1, 2023 07:27
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp force-pushed the get_min_resolved_ts_by_stores branch from 6e0f17d to ae859e2 Compare September 1, 2023 07:28
integration_tests/pd_api_test.go Outdated Show resolved Hide resolved
integration_tests/pd_api_test.go Outdated Show resolved Hide resolved
tikv/kv.go Outdated Show resolved Hide resolved
Signed-off-by: husharp <ihusharp@gmail.com>
@bufferflies bufferflies merged commit 5dd12b0 into tikv:master Sep 5, 2023
10 checks passed
@HuSharp HuSharp deleted the get_min_resolved_ts_by_stores branch September 23, 2023 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd-client: share the connection when GetStoreMinResolvedTS from PD
4 participants