mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fixup! Add --raw mode to ./etcd-dump-log
Signed-off-by: Piotr Tabor <ptab@google.com>
This commit is contained in:
parent
d79bc3fa7e
commit
8ec3cbc551
@ -57,7 +57,7 @@ func testRepair(t *testing.T, ents [][]raftpb.Entry, corrupt corruptFunc, expect
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, es := range ents {
|
||||
assert.NoError(t, w.Save(raftpb.HardState{}, es))
|
||||
require.NoError(t, w.Save(raftpb.HardState{}, es))
|
||||
}
|
||||
|
||||
offset, err := w.tail().Seek(0, io.SeekCurrent)
|
||||
|
@ -67,7 +67,7 @@ func readRaw(lg *zap.Logger, fromIndex *uint64, waldir string, out io.Writer) {
|
||||
continue
|
||||
}
|
||||
if errors.Is(err, io.EOF) {
|
||||
lg.Info("EOF: All entries were processed")
|
||||
fmt.Fprintf(out, "EOF: All entries were processed.\n")
|
||||
break
|
||||
} else {
|
||||
lg.Error("Reading failed", zap.Error(err))
|
||||
|
@ -1,3 +1,16 @@
|
||||
// Copyright 2022 The etcd Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
@ -51,5 +64,6 @@ Entry: Term:25 Index:31 Data:"\010\032\222K\007\n\005role3"
|
||||
Entry: Term:26 Index:32 Data:"\010\033\232K\033\n\005role3\022\022\010\001\022\004Keys\032\010RangeEnd"
|
||||
Entry: Term:27 Index:33 Data:"\010\034\242K\026\n\005role3\022\003key\032\010rangeend"
|
||||
Entry: Term:27 Index:34 Data:"?"
|
||||
EOF: All entries were processed.
|
||||
`, out.String())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user