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

dr-ausosync: report min resolved ts #4716

Merged
merged 13 commits into from
Mar 17, 2022
Merged

dr-ausosync: report min resolved ts #4716

merged 13 commits into from
Mar 17, 2022

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Mar 9, 2022

Signed-off-by: lhy1024 [email protected]

What problem does this PR solve?

Issue Number: ref #4686

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

image

Release note

dr-ausosync: report min resolved ts 

@lhy1024 lhy1024 requested a review from disksing March 9, 2022 15:44
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 9, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • nolouch

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 9, 2022
@codecov
Copy link

codecov bot commented Mar 9, 2022

Codecov Report

Merging #4716 (5d6c960) into master (7e26092) will decrease coverage by 0.09%.
The diff coverage is 64.48%.

❗ Current head 5d6c960 differs from pull request most recent head 3f9c788. Consider uploading reports for the commit 3f9c788 to get more accurate results

@@            Coverage Diff             @@
##           master    #4716      +/-   ##
==========================================
- Coverage   75.09%   75.00%   -0.10%     
==========================================
  Files         284      287       +3     
  Lines       28022    28123     +101     
==========================================
+ Hits        21043    21093      +50     
- Misses       5113     5151      +38     
- Partials     1866     1879      +13     
Flag Coverage Δ
unittests 75.00% <64.48%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/storage/storage.go 70.27% <ø> (ø)
server/grpc_service.go 51.72% <45.45%> (+0.34%) ⬆️
tools/pd-ctl/pdctl/command/min_resolved_ts.go 50.00% <50.00%> (ø)
server/storage/endpoint/min_resolved_ts.go 55.55% <55.55%> (ø)
server/cluster/cluster.go 83.52% <61.11%> (-0.85%) ⬇️
server/api/min_resolved_ts.go 72.72% <72.72%> (ø)
server/api/router.go 99.58% <100.00%> (+<0.01%) ⬆️
server/config/config.go 77.94% <100.00%> (+0.09%) ⬆️
server/config/persist_options.go 93.63% <100.00%> (+0.77%) ⬆️
server/core/store.go 81.68% <100.00%> (+0.34%) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 844d138...3f9c788. Read the comment docs.

Signed-off-by: lhy1024 <[email protected]>
client/client.go Outdated Show resolved Hide resolved
server/grpc_service.go Outdated Show resolved Hide resolved
Signed-off-by: lhy1024 <[email protected]>
server/cluster/cluster.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this resloved ts is cluster-level, do we need the data center-level? such as, Primary DC scope resolved ts and DR DC scop resolved ts. cc @disksing

server/api/min_resolved_ts.go Outdated Show resolved Hide resolved
core.SetMinResolvedTS(minResolvedTS),
)

return c.putStoreLocked(newStore)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has unnecessary writes to etcd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ok to write to etcd. If not write to etcd, it will be lost when PD is shut down or PD leader is changed.

Copy link
Contributor

@nolouch nolouch Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it only write meta information to etcd, actually there is no any update :

func (c *RaftCluster) putStoreLocked(store *core.StoreInfo) error {
	if c.storage != nil {
		if err := c.storage.SaveStore(store.GetMeta()); err != nil {
			return err
		}
	}
	c.core.PutStore(store)
	c.hotStat.GetOrCreateRollingStoreStats(store.GetID())
	return nil
}

server/storage/endpoint/min_resolved_ts.go Outdated Show resolved Hide resolved
Signed-off-by: lhy1024 <[email protected]>
@lhy1024 lhy1024 requested review from nolouch and disksing March 14, 2022 13:04
@disksing
Copy link
Contributor

this resloved ts is cluster-level, do we need the data center-level? such as, Primary DC scope resolved ts and DR DC scop resolved ts. cc @disksing

It should be cluster scope.

Copy link
Member

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Could or should we store the min_resolve_ts once we receive the request instead store it in goroutine?
  2. the path min_resolved_ts is too big, maybe save it to a sub path?

server/storage/endpoint/min_resolved_ts.go Outdated Show resolved Hide resolved
server/storage/endpoint/min_resolved_ts.go Show resolved Hide resolved
@lhy1024
Copy link
Contributor Author

lhy1024 commented Mar 15, 2022

  1. Could or should we store the min_resolve_ts once we receive the request instead store it in goroutine?
  2. the path min_resolved_ts is too big, maybe save it to a sub path?
  1. if there are many stores, it could cause a performance problem. dr-ausosync: report min resolved ts #4716 (comment)

  2. do you have a good idea about the path?

lhy1024 added 2 commits March 15, 2022 12:22
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 15, 2022
Signed-off-by: lhy1024 <[email protected]>
server/api/min_resolved_ts.go Outdated Show resolved Hide resolved
server/core/store.go Show resolved Hide resolved
core.SetMinResolvedTS(minResolvedTS),
)

return c.putStoreLocked(newStore)
Copy link
Contributor

@nolouch nolouch Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it only write meta information to etcd, actually there is no any update :

func (c *RaftCluster) putStoreLocked(store *core.StoreInfo) error {
	if c.storage != nil {
		if err := c.storage.SaveStore(store.GetMeta()); err != nil {
			return err
		}
	}
	c.core.PutStore(store)
	c.hotStat.GetOrCreateRollingStoreStats(store.GetID())
	return nil
}

server/config/config.go Outdated Show resolved Hide resolved
Signed-off-by: lhy1024 <[email protected]>
@lhy1024 lhy1024 requested a review from nolouch March 15, 2022 12:26
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 17, 2022
@nolouch
Copy link
Contributor

nolouch commented Mar 17, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 5d6c960

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 17, 2022
@ti-chi-bot
Copy link
Member

@lhy1024: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit a9a607b into tikv:master Mar 17, 2022
rleungx pushed a commit to rleungx/pd that referenced this pull request Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants