mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etctserver: add failpoints walBeforeSync and walAfterSync
Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
parent
b4e3ed72e3
commit
109873dcb6
2
build
2
build
@ -16,7 +16,7 @@ GO_LDFLAGS="$GO_LDFLAGS -X ${REPO_PATH}/version.GitSHA=${GIT_SHA}"
|
||||
toggle_failpoints() {
|
||||
mode="$1"
|
||||
if command -v gofail >/dev/null 2>&1; then
|
||||
gofail "$mode" etcdserver/ mvcc/backend/
|
||||
gofail "$mode" etcdserver/ mvcc/backend/ wal/
|
||||
elif [[ "$mode" != "disable" ]]; then
|
||||
echo "FAILPOINTS set but gofail not found"
|
||||
exit 1
|
||||
|
@ -949,7 +949,10 @@ func (w *WAL) Save(st raftpb.HardState, ents []raftpb.Entry) error {
|
||||
}
|
||||
if curOff < SegmentSizeBytes {
|
||||
if mustSync {
|
||||
return w.sync()
|
||||
// gofail: var walBeforeSync struct{}
|
||||
err = w.sync()
|
||||
// gofail: var walAfterSync struct{}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user