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

BR: add stream backup meta client #30088

Merged
merged 14 commits into from
Dec 7, 2021
Merged

Conversation

YuJuncen
Copy link
Contributor

What problem does this PR solve?

Issue Number: TiDB (BR) part of #29969

Added the client at BR side for stream backup metadata.

Generally, provided a stream.MetadataClient, which provides operations over the tasks.

What is changed and how it works?

Check List

Tests

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

Release note

None

@YuJuncen YuJuncen added sig/migrate component/br This issue is related to BR of TiDB. labels Nov 24, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 24, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer

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 release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 24, 2021
@YuJuncen YuJuncen changed the title Stream meta BR: add stream backup meta client Nov 24, 2021
@sre-bot
Copy link
Contributor

sre-bot commented Nov 24, 2021

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@YuJuncen YuJuncen marked this pull request as draft November 24, 2021 03:37
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 24, 2021

// Ranges is a vector of [start_key, end_key) pairs.
type Ranges = []Range
type Range = [2][]byte
Copy link
Member

Choose a reason for hiding this comment

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

go.mod Outdated
@@ -102,3 +102,5 @@ replace github.com/pingcap/tidb/parser => ./parser

// fix potential security issue(CVE-2020-26160) introduced by indirect dependency.
replace github.com/dgrijalva/jwt-go => github.com/form3tech-oss/jwt-go v3.2.6-0.20210809144907-32ab6a8243d7+incompatible

replace github.com/pingcap/kvproto => /Users/hillium/Developer/kvproto
Copy link
Contributor

Choose a reason for hiding this comment

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

we can use br-stream branch kvproto in github.

return nil
}

func (c *MetaDataClient) PauseTask(ctx context.Context, taskName string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

how we control TiKV pause observe task.🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to kenny, pausing / resuming is out of our current scope. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

to clarify, it is out of scope because we aren't sure if we want the non-destructive pause/resume or the destructive stop/start, so we delay the feature as it is not essential anyway.


// MinNextBackupTS query the all next backup ts of a store, returning the minimal next backup ts of the store.
func (t *Task) MinNextBackupTS(ctx context.Context, store uint64) (uint64, error) {
min := uint64(0xffffffff)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe 0xFFFFFFFFFFFFFFFF ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just found math.MaxUint64 🦉

@YuJuncen YuJuncen marked this pull request as ready for review December 6, 2021 03:18
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 6, 2021
@YuJuncen
Copy link
Contributor Author

YuJuncen commented Dec 6, 2021

util/memory/meminfo.go:142:12: undefined: os.ReadFile 🤔

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Dec 6, 2021

/build
/run-check_dev

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Dec 6, 2021

/build

@YuJuncen
Copy link
Contributor Author

YuJuncen commented Dec 6, 2021

/run-check_dev

Copy link
Member

@joccau joccau left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Member

@joccau: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

LGTM

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.

Copy link
Contributor

@3pointer 3pointer left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@@ -0,0 +1,171 @@
package stream
Copy link
Contributor

Choose a reason for hiding this comment

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

add the license

@@ -0,0 +1,230 @@
// This package tests the login in MetaClient with a embed etcd.
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -0,0 +1,165 @@
package stream
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -0,0 +1,96 @@
package stream
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 7, 2021
@YuJuncen YuJuncen added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 7, 2021
@ti-chi-bot ti-chi-bot added status/LGT1 Indicates that a PR has LGTM 1. and removed status/LGT2 Indicates that a PR has LGTM 2. labels Dec 7, 2021
@YuJuncen YuJuncen merged commit bcdee32 into pingcap:br-stream Dec 7, 2021
3pointer pushed a commit to 3pointer/tidb that referenced this pull request Feb 22, 2022
* stream: initial commit of stream backup

* br/stream: basic logic of stream backup metadata

* br/stream: add prefix scanner

* br/stream: use types from kv package

* br/stream: unexport prefix scanner(remove it to utils package and export it in need)

* br/stream: move kvproto to br-stream branch, added a playground

* br/stream: added some new functions for playground

* br/stream: added a builder for task

* br/stream: remove playground, use math.MaxUInt64

* br: replace kvproto with br-stream

* br/stream: update error code

* br/stream: fix tests

* br/stream: added copyright
3pointer pushed a commit to 3pointer/tidb that referenced this pull request Mar 9, 2022
* stream: initial commit of stream backup

* br/stream: basic logic of stream backup metadata

* br/stream: add prefix scanner

* br/stream: use types from kv package

* br/stream: unexport prefix scanner(remove it to utils package and export it in need)

* br/stream: move kvproto to br-stream branch, added a playground

* br/stream: added some new functions for playground

* br/stream: added a builder for task

* br/stream: remove playground, use math.MaxUInt64

* br: replace kvproto with br-stream

* br/stream: update error code

* br/stream: fix tests

* br/stream: added copyright
3pointer pushed a commit that referenced this pull request Mar 21, 2022
* stream: initial commit of stream backup

* br/stream: basic logic of stream backup metadata

* br/stream: add prefix scanner

* br/stream: use types from kv package

* br/stream: unexport prefix scanner(remove it to utils package and export it in need)

* br/stream: move kvproto to br-stream branch, added a playground

* br/stream: added some new functions for playground

* br/stream: added a builder for task

* br/stream: remove playground, use math.MaxUInt64

* br: replace kvproto with br-stream

* br/stream: update error code

* br/stream: fix tests

* br/stream: added copyright
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. release-note-none Denotes a PR that doesn't merit a release note. sig/migrate size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants