Skip to content

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

Merged
bufferflies merged 18 commits intotikv:masterfrom
HuSharp:get_min_resolved_ts_by_stores
Sep 5, 2023
Merged

tikv/safeTS: obtain min-resolved-ts by store list#921
bufferflies merged 18 commits intotikv:masterfrom
HuSharp:get_min_resolved_ts_by_stores

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!

@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
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@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>
HuSharp added 2 commits August 3, 2023 11:25
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

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
Signed-off-by: husharp <ihusharp@gmail.com>
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