diff --git a/server/storage/backend/batch_tx.go b/server/storage/backend/batch_tx.go index 4ee05810f24..63b422fbb55 100644 --- a/server/storage/backend/batch_tx.go +++ b/server/storage/backend/batch_tx.go @@ -337,7 +337,9 @@ func (t *batchTxBuffered) commit(stop bool) { func (t *batchTxBuffered) unsafeCommit(stop bool) { if t.backend.hooks != nil { + // gofail: var commitBeforePreCommitHook struct{} t.backend.hooks.OnPreCommitUnsafe(t) + // gofail: var commitAfterPreCommitHook struct{} } if t.backend.readTx.tx != nil { diff --git a/tests/linearizability/failpoints.go b/tests/linearizability/failpoints.go index a9d01392fe0..17384619c18 100644 --- a/tests/linearizability/failpoints.go +++ b/tests/linearizability/failpoints.go @@ -31,16 +31,19 @@ import ( ) var ( - KillFailpoint Failpoint = killFailpoint{} - DefragBeforeCopyPanic Failpoint = goFailpoint{"backend/defragBeforeCopy", "panic", triggerDefrag} - DefragBeforeRenamePanic Failpoint = goFailpoint{"backend/defragBeforeRename", "panic", triggerDefrag} - BeforeCommitPanic Failpoint = goFailpoint{"backend/beforeCommit", "panic", nil} - AfterCommitPanic Failpoint = goFailpoint{"backend/afterCommit", "panic", nil} - RaftBeforeSavePanic Failpoint = goFailpoint{"etcdserver/raftBeforeSave", "panic", nil} - RaftAfterSavePanic Failpoint = goFailpoint{"etcdserver/raftAfterSave", "panic", nil} - RandomFailpoint Failpoint = randomFailpoint{[]Failpoint{ + KillFailpoint Failpoint = killFailpoint{} + DefragBeforeCopyPanic Failpoint = goFailpoint{"backend/defragBeforeCopy", "panic", triggerDefrag} + DefragBeforeRenamePanic Failpoint = goFailpoint{"backend/defragBeforeRename", "panic", triggerDefrag} + BeforeCommitPanic Failpoint = goFailpoint{"backend/beforeCommit", "panic", nil} + AfterCommitPanic Failpoint = goFailpoint{"backend/afterCommit", "panic", nil} + RaftBeforeSavePanic Failpoint = goFailpoint{"etcdserver/raftBeforeSave", "panic", nil} + RaftAfterSavePanic Failpoint = goFailpoint{"etcdserver/raftAfterSave", "panic", nil} + CommitBeforePreCommitHookPanic Failpoint = goFailpoint{"backend/commitBeforePreCommitHook", "panic", nil} + CommitAfterPreCommitHookPanic Failpoint = goFailpoint{"backend/commitAfterPreCommitHook", "panic", nil} + RandomFailpoint Failpoint = randomFailpoint{[]Failpoint{ KillFailpoint, BeforeCommitPanic, AfterCommitPanic, RaftBeforeSavePanic, RaftAfterSavePanic, DefragBeforeCopyPanic, DefragBeforeRenamePanic, + CommitBeforePreCommitHookPanic, CommitAfterPreCommitHookPanic, }} // TODO: Figure out how to reliably trigger below failpoints and add them to RandomFailpoint raftBeforeLeaderSendPanic Failpoint = goFailpoint{"etcdserver/raftBeforeLeaderSend", "panic", nil}