Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions server/storage/mvcc/watchable_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ func (s *watchableStore) syncVictimsLoop() {

// moveVictims tries to update watches with already pending event data
func (s *watchableStore) moveVictims() (moved int) {
// gofail: var beforeMoveVictims struct{}
s.mu.Lock()
victims := s.victims
s.victims = nil
Expand Down Expand Up @@ -344,6 +345,7 @@ func (s *watchableStore) moveVictims() (moved int) {
// 3. use minimum revision to get all key-value pairs and send those events to watchers
// 4. remove synced watchers in set from unsynced group and move to synced group
func (s *watchableStore) syncWatchers() int {
// gofail: var beforeSyncWatchers struct{}
s.mu.Lock()
defer s.mu.Unlock()

Expand Down Expand Up @@ -513,6 +515,7 @@ func (s *watchableStore) progressAll(watchers map[WatchID]*watcher) bool {
}

func (s *watchableStore) progressIfSync(watchers map[WatchID]*watcher, responseWatchID WatchID) bool {
// gofail: var beforeProgressIfSync struct{}
s.mu.RLock()
defer s.mu.RUnlock()

Expand Down
3 changes: 3 additions & 0 deletions tests/robustness/failpoint/failpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ var allFailpoints = []Failpoint{
RaftAfterSaveSleep,
ApplyBeforeOpenSnapshot,
SleepBeforeSendWatchResponse,
SleepBeforeSyncWatchers,
SleepBeforeMoveVictims,
SleepBeforeProgressIfSync,
}

func PickRandom(clus *e2e.EtcdProcessCluster, profile traffic.Profile) (Failpoint, error) {
Expand Down
3 changes: 3 additions & 0 deletions tests/robustness/failpoint/gofail.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ var (
RaftBeforeSaveSleep Failpoint = gofailSleepAndDeactivate{"raftBeforeSave", time.Second}
RaftAfterSaveSleep Failpoint = gofailSleepAndDeactivate{"raftAfterSave", time.Second}
SleepBeforeSendWatchResponse Failpoint = gofailSleepAndDeactivate{"beforeSendWatchResponse", time.Second}
SleepBeforeSyncWatchers Failpoint = gofailSleepAndDeactivate{"beforeSyncWatchers", time.Second}
SleepBeforeMoveVictims Failpoint = gofailSleepAndDeactivate{"beforeMoveVictims", time.Second}
SleepBeforeProgressIfSync Failpoint = gofailSleepAndDeactivate{"beforeProgressIfSync", time.Second}
)

type goPanicFailpoint struct {
Expand Down