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

Optimize WAL verification #155

Merged
merged 1 commit into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
371 changes: 271 additions & 100 deletions Gopkg.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ required = ["github.com/coreos/bbolt"]

[[constraint]]
name = "github.com/coreos/etcd"
version = "3.3.8"
version = "3.3.13"

[[constraint]]
name = "github.com/coreos/bbolt"
Expand Down
13 changes: 2 additions & 11 deletions pkg/initializer/validator/datavalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,11 @@ func checkSuffix(names []string) []string {
}

func verifyWALDir(waldir string, snap walpb.Snapshot) error {
var (
err error
w *wal.WAL
)
var err error

repaired := false
for {
w, err = wal.Open(waldir, snap)
if err != nil {
return fmt.Errorf("open wal error: %v", err)
}
if _, _, _, err = w.ReadAll(); err != nil {
w.Close()
if err = wal.Verify(waldir, snap); err != nil {
// we can only repair ErrUnexpectedEOF and we never repair twice.
if repaired || err != io.ErrUnexpectedEOF {
fmt.Printf("read wal error (%v) and cannot be repaired.\n", err)
Expand All @@ -308,7 +300,6 @@ func verifyWALDir(waldir string, snap walpb.Snapshot) error {

continue
}
w.Close()
break
}
return err
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 74 additions & 14 deletions vendor/github.com/Azure/azure-pipeline-go/pipeline/error.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/BurntSushi/toml/cmd/tomlv/COPYING

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading