Skip to content
Closed
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
12 changes: 12 additions & 0 deletions server/mvcc/watchable_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
package mvcc

import (
"fmt"
"sync"
"time"

"go.etcd.io/etcd/api/v3/mvccpb"
"go.etcd.io/etcd/client/pkg/v3/verify"

Check failure on line 23 in server/mvcc/watchable_store.go

View workflow job for this annotation

GitHub Actions / test

could not import go.etcd.io/etcd/client/pkg/v3/verify (invalid package name: "")

Check failure on line 23 in server/mvcc/watchable_store.go

View workflow job for this annotation

GitHub Actions / test

could not import go.etcd.io/etcd/client/pkg/v3/verify (invalid package name: "")

Check failure on line 23 in server/mvcc/watchable_store.go

View workflow job for this annotation

GitHub Actions / test

could not import go.etcd.io/etcd/client/pkg/v3/verify (invalid package name: "")

Check failure on line 23 in server/mvcc/watchable_store.go

View workflow job for this annotation

GitHub Actions / test

no required module provides package go.etcd.io/etcd/client/pkg/v3/verify; to add it:

Check failure on line 23 in server/mvcc/watchable_store.go

View workflow job for this annotation

GitHub Actions / test

could not import go.etcd.io/etcd/client/pkg/v3/verify (invalid package name: "")

Check failure on line 23 in server/mvcc/watchable_store.go

View workflow job for this annotation

GitHub Actions / test

could not import go.etcd.io/etcd/client/pkg/v3/verify (invalid package name: "")
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/pkg/v3/traceutil"
"go.etcd.io/etcd/server/v3/lease"
Expand Down Expand Up @@ -571,6 +573,16 @@
wr.Events = ne
}

verify.Verify(func() {
if w.startRev > 0 {
for _, ev := range wr.Events {
if ev.Kv.ModRevision < w.startRev {
panic(fmt.Sprintf("Event.ModRevision(%d) is less than the w.startRev(%d) for watchID: %d", ev.Kv.ModRevision, w.startRev, w.id))
}
}
}
})

// if all events are filtered out, we should send nothing.
if !progressEvent && len(wr.Events) == 0 {
return true
Expand Down
Loading