diff --git a/Makefile b/Makefile index 195573aab..c9d0ac442 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ GOFAIL_VERSION = $(shell cd tools/mod && go list -m -f {{.Version}} go.etcd.io/g .PHONY: gofail-enable gofail-enable: install-gofail - gofail enable server/etcdserver/ server/storage/backend/ server/storage/mvcc/ + gofail enable server/etcdserver/ server/storage/backend/ server/storage/mvcc/ server/storage/wal/ cd ./server && go get go.etcd.io/gofail@${GOFAIL_VERSION} cd ./etcdutl && go get go.etcd.io/gofail@${GOFAIL_VERSION} cd ./etcdctl && go get go.etcd.io/gofail@${GOFAIL_VERSION} @@ -123,7 +123,7 @@ gofail-enable: install-gofail .PHONY: gofail-disable gofail-disable: install-gofail - gofail disable server/etcdserver/ server/storage/backend/ server/storage/mvcc/ + gofail disable server/etcdserver/ server/storage/backend/ server/storage/mvcc/ server/storage/wal/ cd ./server && go mod tidy cd ./etcdutl && go mod tidy cd ./etcdctl && go mod tidy diff --git a/server/storage/wal/wal.go b/server/storage/wal/wal.go index ff24ca86a..7f8b25f5d 100644 --- a/server/storage/wal/wal.go +++ b/server/storage/wal/wal.go @@ -950,7 +950,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 }