-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
After you have format title, you can leave a comment |
br/pkg/stream/models.go
Outdated
|
||
// Ranges is a vector of [start_key, end_key) pairs. | ||
type Ranges = []Range | ||
type Range = [2][]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use kv.KeyRange directly ?
https://github.com/pingcap/tidb/blob/master/kv/key.go#L91
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.🤔
There was a problem hiding this comment.
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. 🤔
There was a problem hiding this comment.
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.
br/pkg/stream/client.go
Outdated
|
||
// 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe 0xFFFFFFFFFFFFFFFF ?
There was a problem hiding this comment.
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
🦉
|
/build |
/build |
/run-check_dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@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:
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. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
* 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
* 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
* 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
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
Release note