This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Implement Raw Restore #104
Merged
Merged
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
1679ab5
Update kvproto
MyonKeminta ee18eaa
Implement raw restore
MyonKeminta a92fbad
Merge branch 'master' of https://github.com/pingcap/br into m/raw-res…
MyonKeminta 838fe4c
fix build
MyonKeminta 501eb9b
Set range for file importer
MyonKeminta f1c803d
Remove unnecessary comments
MyonKeminta cdd7449
check cf and support multi ranges in BackupMeta
MyonKeminta da2c5cd
Check files' cf; address comments
MyonKeminta 3af0a4f
Merge branch 'master' of https://github.com/pingcap/br into m/raw-res…
MyonKeminta c7c7243
adjust structure to keep consistent with master
MyonKeminta d3accd6
Merge branch 'master' of https://github.com/pingcap/br into m/raw-res…
MyonKeminta 5816304
Fix build
MyonKeminta 78c1757
Merge branch 'master' of https://github.com/pingcap/br into m/raw-res…
MyonKeminta 1a5c99b
Merge branch 'master' of https://github.com/pingcap/br into m/raw-res…
MyonKeminta 3f9b16b
Fix build and make check, avoid accessing TiDB in rawkv mode
MyonKeminta 5d54e71
Merge branch 'master' into m/raw-restore
3pointer 65c9e43
Fix test
MyonKeminta 07f1021
Merge branch 'm/raw-restore' of https://github.com/MyonKeminta/br int…
MyonKeminta 4638167
Fix tests
MyonKeminta 5bea24b
Fix broken logic after merging master
MyonKeminta 429c548
Merge branch 'master' of https://github.com/pingcap/br into m/raw-res…
MyonKeminta 42f50e4
Update pkg/task/restore_raw.go
MyonKeminta 0acc3d8
Address comments
MyonKeminta 51cf368
Address comments
MyonKeminta ecf46eb
Mark raw restore as experimental
MyonKeminta a106210
Merge branch 'master' into m/raw-restore
3pointer 5c1540f
Merge branch 'm/raw-restore' of https://github.com/MyonKeminta/br int…
MyonKeminta 3d14041
Fix build
MyonKeminta c4500a8
Address comments
MyonKeminta f1e7b05
test: Add check for deleting data and partial backup
MyonKeminta 47b9558
Merge branch 'master' into m/raw-restore
3pointer c4e6a51
Fix build
MyonKeminta a1e0f0e
Add license header
MyonKeminta 0bac6cc
Merge branch 'master' into m/raw-restore
sre-bot 2606719
fix ci
3pointer 35070c3
fix ci
3pointer 2fa84cd
Merge branch 'master' into m/raw-restore
3pointer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package gluetikv | ||
|
||
import ( | ||
pd "github.com/pingcap/pd/client" | ||
"github.com/pingcap/tidb/config" | ||
"github.com/pingcap/tidb/domain" | ||
"github.com/pingcap/tidb/kv" | ||
"github.com/pingcap/tidb/store/tikv" | ||
|
||
"github.com/pingcap/br/pkg/glue" | ||
) | ||
|
||
// Glue is an implementation of glue.Glue that accesses only TiKV without TiDB. | ||
type Glue struct{} | ||
|
||
// GetDomain implements glue.Glue | ||
func (Glue) GetDomain(store kv.Storage) (*domain.Domain, error) { | ||
return nil, nil | ||
} | ||
|
||
// CreateSession implements glue.Glue | ||
func (Glue) CreateSession(store kv.Storage) (glue.Session, error) { | ||
return nil, nil | ||
} | ||
|
||
// Open implements glue.Glue | ||
func (Glue) Open(path string, option pd.SecurityOption) (kv.Storage, error) { | ||
if option.CAPath != "" { | ||
conf := config.GetGlobalConfig() | ||
conf.Security.ClusterSSLCA = option.CAPath | ||
conf.Security.ClusterSSLCert = option.CertPath | ||
conf.Security.ClusterSSLKey = option.KeyPath | ||
config.StoreGlobalConfig(conf) | ||
} | ||
return tikv.Driver{}.Open(path) | ||
} | ||
|
||
// OwnsStorage implements glue.Glue | ||
func (Glue) OwnsStorage() bool { | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The cobra commands should just handle cli options and then call a function. Then it will be easy to create other interfaces to br or to use as a library.
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.
Sorry I don't know. I just tried to keep my code consistent with other commands here. @5kbpers Do you have any idea?