mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add failpoints walBeforeSync and walAfterSync
Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
parent
9bae010994
commit
1fe7b9793a
4
Makefile
4
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
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user