Browse Source

grpcproxy: respect CompactRevision in watcher

CompactRevision wasn't sent over watch stream, causing TestKVCompact to hang.
Anthony Romano 8 years ago
parent
commit
853f68071b
1 changed files with 6 additions and 5 deletions
  1. 6 5
      proxy/grpcproxy/watcher.go

+ 6 - 5
proxy/grpcproxy/watcher.go

@@ -102,16 +102,17 @@ func (w *watcher) send(wr clientv3.WatchResponse) {
 	}
 
 	// all events are filtered out?
-	if !wr.IsProgressNotify() && !wr.Created && len(events) == 0 {
+	if !wr.IsProgressNotify() && !wr.Created && len(events) == 0 && wr.CompactRevision == 0 {
 		return
 	}
 
 	w.lastHeader = wr.Header
 	w.post(&pb.WatchResponse{
-		Header:  &wr.Header,
-		Created: wr.Created,
-		WatchId: w.id,
-		Events:  events,
+		Header:          &wr.Header,
+		Created:         wr.Created,
+		CompactRevision: wr.CompactRevision,
+		WatchId:         w.id,
+		Events:          events,
 	})
 }