From dced92f8bd4780d98e8a0db5445c9fffbb562cf0 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 27 Jun 2016 12:20:36 -0700 Subject: [PATCH] *: support watch with filters Now user can filter events with types. The API is also extensible. It might make sense for the proxy to filter out events based on more expensive/customized filter. --- .../apispec/swagger/rpc.swagger.json | 16 + etcdserver/api/v3rpc/watch.go | 21 +- etcdserver/etcdserverpb/rpc.pb.go | 451 ++++++++++-------- etcdserver/etcdserverpb/rpc.proto | 9 + integration/v3_watch_test.go | 68 +++ mvcc/watchable_store.go | 63 ++- mvcc/watcher.go | 9 +- mvcc/watcher_test.go | 37 ++ 8 files changed, 459 insertions(+), 215 deletions(-) diff --git a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json index 7fa6cea9e..88cf7845c 100644 --- a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json @@ -181,6 +181,15 @@ ], "default": "KEY" }, + "WatchCreateRequestFilterType": { + "type": "string", + "enum": [ + "NOPUT", + "NODELETE" + ], + "default": "NOPUT", + "description": "- NOPUT: filter out put event.\n - NODELETE: filter out delete event." + }, "authpbPermission": { "type": "object", "properties": { @@ -1171,6 +1180,13 @@ "etcdserverpbWatchCreateRequest": { "type": "object", "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/WatchCreateRequestFilterType" + }, + "description": "filters filter the events at server side before it sends back to the watcher." + }, "key": { "type": "string", "format": "byte", diff --git a/etcdserver/api/v3rpc/watch.go b/etcdserver/api/v3rpc/watch.go index fc4eb8d55..d6f48cfcd 100644 --- a/etcdserver/api/v3rpc/watch.go +++ b/etcdserver/api/v3rpc/watch.go @@ -164,12 +164,23 @@ func (sws *serverWatchStream) recvLoop() error { // support >= key queries creq.RangeEnd = []byte{} } + filters := make([]mvcc.FilterFunc, 0, len(creq.Filters)) + for _, ft := range creq.Filters { + switch ft { + case pb.WatchCreateRequest_NOPUT: + filters = append(filters, filterNoPut) + case pb.WatchCreateRequest_NODELETE: + filters = append(filters, filterNoDelete) + default: + } + } + wsrev := sws.watchStream.Rev() rev := creq.StartRevision if rev == 0 { rev = wsrev + 1 } - id := sws.watchStream.Watch(creq.Key, creq.RangeEnd, rev) + id := sws.watchStream.Watch(creq.Key, creq.RangeEnd, rev, filters...) if id != -1 && creq.ProgressNotify { sws.progress[id] = true } @@ -322,3 +333,11 @@ func (sws *serverWatchStream) newResponseHeader(rev int64) *pb.ResponseHeader { RaftTerm: sws.raftTimer.Term(), } } + +func filterNoDelete(e mvccpb.Event) bool { + return e.Type == mvccpb.DELETE +} + +func filterNoPut(e mvccpb.Event) bool { + return e.Type == mvccpb.PUT +} diff --git a/etcdserver/etcdserverpb/rpc.pb.go b/etcdserver/etcdserverpb/rpc.pb.go index 0118d8985..74c4e4868 100644 --- a/etcdserver/etcdserverpb/rpc.pb.go +++ b/etcdserver/etcdserverpb/rpc.pb.go @@ -154,6 +154,31 @@ func (x Compare_CompareTarget) String() string { } func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 1} } +type WatchCreateRequest_FilterType int32 + +const ( + // filter out put event. + WatchCreateRequest_NOPUT WatchCreateRequest_FilterType = 0 + // filter out delete event. + WatchCreateRequest_NODELETE WatchCreateRequest_FilterType = 1 +) + +var WatchCreateRequest_FilterType_name = map[int32]string{ + 0: "NOPUT", + 1: "NODELETE", +} +var WatchCreateRequest_FilterType_value = map[string]int32{ + "NOPUT": 0, + "NODELETE": 1, +} + +func (x WatchCreateRequest_FilterType) String() string { + return proto.EnumName(WatchCreateRequest_FilterType_name, int32(x)) +} +func (WatchCreateRequest_FilterType) EnumDescriptor() ([]byte, []int) { + return fileDescriptorRpc, []int{19, 0} +} + type AlarmRequest_AlarmAction int32 const ( @@ -1119,6 +1144,8 @@ type WatchCreateRequest struct { // wish to recover a disconnected watcher starting from a recent known revision. // The etcd server may decide how often it will send notifications based on current load. ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,json=progressNotify,proto3" json:"progress_notify,omitempty"` + // filters filter the events at server side before it sends back to the watcher. + Filters []WatchCreateRequest_FilterType `protobuf:"varint,5,rep,name=filters,enum=etcdserverpb.WatchCreateRequest_FilterType" json:"filters,omitempty"` } func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} } @@ -2044,6 +2071,7 @@ func init() { proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) + proto.RegisterEnum("etcdserverpb.WatchCreateRequest_FilterType", WatchCreateRequest_FilterType_name, WatchCreateRequest_FilterType_value) proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value) } @@ -4433,6 +4461,13 @@ func (m *WatchCreateRequest) MarshalTo(data []byte) (int, error) { } i++ } + if len(m.Filters) > 0 { + for _, num := range m.Filters { + data[i] = 0x28 + i++ + i = encodeVarintRpc(data, i, uint64(num)) + } + } return i, nil } @@ -6585,6 +6620,11 @@ func (m *WatchCreateRequest) Size() (n int) { if m.ProgressNotify { n += 2 } + if len(m.Filters) > 0 { + for _, e := range m.Filters { + n += 1 + sovRpc(uint64(e)) + } + } return n } @@ -9770,6 +9810,26 @@ func (m *WatchCreateRequest) Unmarshal(data []byte) error { } } m.ProgressNotify = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + } + var v WatchCreateRequest_FilterType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Filters = append(m.Filters, v) default: iNdEx = preIndex skippy, err := skipRpc(data[iNdEx:]) @@ -15125,200 +15185,203 @@ var ( ) var fileDescriptorRpc = []byte{ - // 3116 bytes of a gzipped FileDescriptorProto + // 3167 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x5a, 0x4b, 0x73, 0x24, 0x47, 0x11, 0xde, 0x79, 0xe8, 0x31, 0x39, 0xa3, 0x59, 0x6d, 0x49, 0xbb, 0x1e, 0xf5, 0x6a, 0xb5, 0xda, - 0xda, 0xa7, 0x5f, 0x1a, 0x2c, 0x1b, 0x0e, 0x40, 0x38, 0x62, 0xa4, 0x19, 0xd6, 0xb2, 0x64, 0x69, - 0xdd, 0x9a, 0x95, 0x4d, 0x04, 0x81, 0xa2, 0x35, 0x53, 0x2b, 0x4d, 0x68, 0x5e, 0xee, 0xee, 0xd1, - 0x4a, 0x06, 0x22, 0x08, 0x07, 0x3e, 0xc0, 0xd5, 0x07, 0x02, 0x38, 0xf2, 0x1b, 0xb8, 0xf1, 0x03, - 0x08, 0x2e, 0x38, 0x82, 0x23, 0x17, 0x82, 0xe0, 0xc0, 0x81, 0x3b, 0xc1, 0x09, 0xea, 0xd9, 0x5d, - 0xdd, 0x53, 0x3d, 0x92, 0x69, 0x7c, 0xd8, 0x55, 0x57, 0x56, 0x56, 0x7e, 0x59, 0x59, 0x95, 0xd9, - 0x99, 0xd9, 0x03, 0x05, 0x77, 0xd8, 0x5a, 0x1b, 0xba, 0x03, 0x7f, 0x80, 0x4a, 0xc4, 0x6f, 0xb5, - 0x3d, 0xe2, 0x9e, 0x11, 0x77, 0x78, 0x64, 0x2d, 0x1e, 0x0f, 0x8e, 0x07, 0x7c, 0xa2, 0xca, 0x9e, - 0x04, 0x8f, 0xb5, 0xc4, 0x78, 0xaa, 0xbd, 0xb3, 0x56, 0x8b, 0xff, 0x37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0x61, 0xad, 0xdb, 0x39, 0x4b, 0x44, 0x1d, 0xc2, 0xad, 0x38, 0xe3, 0xd7, 0x6b, 0x23, 0x7c, 0x02, - 0xd3, 0x1f, 0xf0, 0x1a, 0x54, 0xd3, 0x25, 0xcf, 0x79, 0x69, 0x84, 0xe9, 0x3b, 0x3d, 0x91, 0xce, - 0x17, 0x6c, 0xfe, 0xcc, 0xa3, 0x39, 0x21, 0xee, 0x73, 0x7b, 0x47, 0xbc, 0x35, 0x0a, 0x76, 0x30, - 0x46, 0x2b, 0xac, 0xfa, 0xed, 0xd0, 0xeb, 0xc1, 0x67, 0xf3, 0x7c, 0x56, 0xa3, 0xd0, 0x4a, 0x6a, - 0x5e, 0x20, 0xd5, 0xda, 0x6d, 0xed, 0xcd, 0x11, 0xc8, 0xcb, 0x44, 0xe5, 0xe1, 0x97, 0x70, 0x43, - 0xe3, 0x4f, 0x65, 0x86, 0x37, 0x60, 0x5a, 0x14, 0xda, 0x32, 0x68, 0x2d, 0x46, 0x57, 0x09, 0x18, - 0x5b, 0xf2, 0xe0, 0x87, 0xb0, 0x20, 0x29, 0xa4, 0x37, 0x30, 0x9d, 0x15, 0xb7, 0x0f, 0xde, 0x81, - 0xc5, 0x28, 0x5b, 0xaa, 0x2b, 0x52, 0x53, 0xa0, 0xcf, 0x87, 0x6d, 0x2d, 0x06, 0xc6, 0x0f, 0x45, - 0x37, 0x58, 0x36, 0x66, 0xb0, 0x40, 0x21, 0x25, 0x22, 0x95, 0x42, 0x0b, 0xca, 0xfc, 0x3b, 0x1d, - 0x2f, 0x78, 0xd3, 0x7d, 0x0a, 0x48, 0x27, 0xa6, 0x3a, 0x94, 0x35, 0x98, 0x11, 0x06, 0x57, 0xc9, - 0x94, 0xf9, 0x54, 0x14, 0x13, 0x53, 0xa8, 0x4e, 0x5e, 0xb8, 0xce, 0x71, 0x8f, 0x04, 0x31, 0x87, - 0xa5, 0x10, 0x3a, 0x31, 0xd5, 0x8e, 0xff, 0x44, 0x5f, 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, 0x76, 0xef, - 0x78, 0xfd, 0xa4, 0x77, 0xf3, 0xe8, 0x25, 0xaf, 0x8d, 0xfc, 0x93, 0x46, 0x9f, 0x35, 0xae, 0xd4, - 0x0e, 0x17, 0x01, 0x31, 0x62, 0xbd, 0xe3, 0xe9, 0xd4, 0x06, 0x2c, 0x30, 0x2a, 0xbd, 0xf7, 0x34, - 0x99, 0x0e, 0x23, 0x86, 0x0a, 0xdb, 0x99, 0x58, 0xd8, 0x76, 0x3c, 0xef, 0xe5, 0xc0, 0x6d, 0xcb, - 0xad, 0x05, 0x63, 0x5c, 0x17, 0xc2, 0x9f, 0x7b, 0x91, 0xc0, 0xfc, 0x55, 0xa5, 0x3c, 0x09, 0xa5, - 0x3c, 0x25, 0xfe, 0x04, 0x29, 0xf8, 0x75, 0xb8, 0xa9, 0x38, 0x65, 0x0d, 0x3d, 0x81, 0x79, 0x0f, - 0xee, 0x28, 0xe6, 0xcd, 0x13, 0x96, 0xe8, 0x3d, 0x93, 0x80, 0xff, 0xab, 0x9e, 0x1b, 0x50, 0x09, - 0xf4, 0xe4, 0x39, 0xc8, 0xa0, 0xab, 0x2b, 0x30, 0xf2, 0xe4, 0x9d, 0xa1, 0xb2, 0xd8, 0x33, 0xa3, - 0xb9, 0x94, 0x45, 0xbd, 0x04, 0xd9, 0x33, 0xde, 0x84, 0x25, 0x25, 0x43, 0x66, 0x07, 0x51, 0x21, - 0x63, 0x0a, 0x99, 0x84, 0x48, 0x83, 0xb1, 0xa5, 0x93, 0xcd, 0xae, 0x73, 0x46, 0x4d, 0xcb, 0x65, - 0x66, 0x34, 0x99, 0x37, 0xc5, 0x8d, 0x60, 0x8a, 0xe9, 0x41, 0x5b, 0x92, 0x99, 0x00, 0x9d, 0x2c, - 0x0f, 0x82, 0x91, 0xc7, 0x0e, 0x62, 0x4c, 0xf4, 0x0f, 0x60, 0x25, 0x50, 0x82, 0xd9, 0xed, 0x19, - 0xbd, 0xac, 0x1d, 0xcf, 0xd3, 0x8a, 0x40, 0xd3, 0xc6, 0x1f, 0x41, 0x7e, 0x48, 0x64, 0x4c, 0x29, - 0xae, 0xa3, 0x35, 0xd1, 0x63, 0x5f, 0xd3, 0x16, 0xf3, 0x79, 0xdc, 0x86, 0xbb, 0x4a, 0xba, 0xb0, - 0xa8, 0x51, 0x7c, 0x5c, 0x29, 0x55, 0x20, 0x08, 0xb3, 0x8e, 0x17, 0x08, 0x39, 0x71, 0xf6, 0x41, - 0xab, 0xef, 0x7d, 0x61, 0x48, 0xe5, 0x5b, 0xa9, 0xde, 0x15, 0xdb, 0xc2, 0xa6, 0x81, 0x4b, 0xa6, - 0x12, 0x76, 0x04, 0x8b, 0x51, 0x4f, 0x4e, 0x15, 0xc6, 0x68, 0xd6, 0xeb, 0x53, 0x13, 0xaa, 0x20, - 0x26, 0x06, 0x4a, 0xe1, 0xc0, 0xcd, 0x53, 0x29, 0xec, 0x84, 0xc2, 0xf8, 0x95, 0x4c, 0xab, 0x2f, - 0x3b, 0x4d, 0x95, 0xcf, 0x88, 0x01, 0xde, 0x85, 0x5b, 0xf1, 0x30, 0x91, 0x4a, 0xe5, 0x03, 0x71, - 0x81, 0x4d, 0x91, 0x24, 0x95, 0xdc, 0x0f, 0xc3, 0x60, 0xa0, 0x05, 0x94, 0x54, 0x22, 0x6d, 0xb0, - 0x4c, 0xf1, 0xe5, 0xff, 0x71, 0x5f, 0x83, 0x70, 0x93, 0x4a, 0x98, 0x17, 0x0a, 0x4b, 0x7f, 0xfc, - 0x61, 0x8c, 0xc8, 0x4d, 0x8c, 0x11, 0xd2, 0x49, 0xc2, 0x28, 0xf6, 0x35, 0x5c, 0x3a, 0x89, 0x11, - 0x06, 0xd0, 0xb4, 0x18, 0xec, 0x1d, 0x12, 0x60, 0xf0, 0x81, 0xba, 0xd8, 0x7a, 0xd8, 0x4d, 0x75, - 0x18, 0x1f, 0x85, 0xb1, 0x73, 0x2c, 0x32, 0xa7, 0x12, 0xfc, 0x31, 0xac, 0x26, 0x07, 0xe5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fe, 0xa8, 0x0a, 0xa2, 0x2d, 0x63, 0x56, 0x21, - 0xd2, 0xf5, 0x31, 0xab, 0x10, 0xed, 0xea, 0x5c, 0xae, 0xc2, 0x88, 0xf3, 0x33, 0x15, 0xce, 0x01, - 0xc2, 0xae, 0x0d, 0x32, 0x1a, 0x57, 0x2b, 0x0c, 0xe2, 0x37, 0x7f, 0xbc, 0xe1, 0x83, 0x1f, 0x73, - 0xec, 0x7b, 0x78, 0x39, 0x09, 0xbb, 0x4b, 0xb9, 0x99, 0x9f, 0xff, 0x3e, 0x0f, 0xc5, 0x0f, 0x9c, - 0x4e, 0xdf, 0x27, 0x7d, 0xd6, 0x8c, 0x46, 0xc7, 0x30, 0xc5, 0x23, 0x7f, 0xdc, 0xdd, 0xf5, 0x56, - 0x4a, 0xdc, 0xdd, 0x23, 0x7d, 0x06, 0xfc, 0x90, 0x43, 0xdf, 0xc5, 0x56, 0x00, 0xdd, 0x0b, 0xe5, - 0x57, 0x79, 0x8f, 0x80, 0x6d, 0xf9, 0x14, 0xa6, 0x45, 0x4f, 0x00, 0xc5, 0xa4, 0x45, 0x7a, 0x07, - 0xd6, 0xb2, 0x79, 0x32, 0xf1, 0x96, 0xe9, 0x58, 0x1e, 0x67, 0x66, 0x60, 0x3f, 0x02, 0x08, 0x9b, - 0x50, 0x71, 0xfb, 0x8e, 0xf5, 0xac, 0xac, 0xd5, 0x64, 0x06, 0x09, 0xfc, 0x1a, 0x07, 0x7e, 0x80, - 0xef, 0x1a, 0x81, 0xdb, 0xc1, 0x02, 0x06, 0xde, 0x82, 0x3c, 0xfb, 0xd2, 0x85, 0x62, 0xa1, 0x5f, - 0xfb, 0x18, 0x66, 0x59, 0xa6, 0x29, 0x09, 0xf5, 0x80, 0x43, 0xad, 0xe0, 0x25, 0x23, 0x14, 0xfb, - 0xe2, 0xc5, 0x40, 0x46, 0x30, 0xab, 0x3e, 0x70, 0xa1, 0x3b, 0x31, 0x9b, 0x45, 0x3f, 0x86, 0x59, - 0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19, 0xf7, 0x31, 0x95, 0x86, 0xe4, 0x7a, 0x6d, + 0x72, 0xa3, 0x00, 0x33, 0x92, 0x8a, 0xff, 0x95, 0x01, 0x50, 0x3e, 0xa2, 0xfb, 0xad, 0x43, 0xd9, + 0x95, 0xa3, 0xc8, 0x86, 0x6f, 0x1a, 0x37, 0x2c, 0x5d, 0x7b, 0xc5, 0x9e, 0x53, 0x8b, 0xc4, 0x96, + 0xdf, 0x85, 0x52, 0x20, 0x25, 0xdc, 0xf3, 0x92, 0x61, 0xcf, 0x81, 0x84, 0xa2, 0x5a, 0xc0, 0x76, + 0xfd, 0x31, 0x5c, 0x0f, 0xd6, 0x1b, 0xb6, 0x7d, 0x67, 0xc2, 0xb6, 0x03, 0x81, 0x0b, 0x4a, 0x82, + 0xbe, 0x71, 0x60, 0x60, 0x29, 0xc8, 0xf8, 0xd7, 0x39, 0x98, 0xd9, 0x1c, 0xf4, 0x86, 0x8e, 0xcb, + 0xce, 0x68, 0x9a, 0xd2, 0x47, 0x5d, 0x9f, 0x6f, 0xb7, 0xbc, 0x7e, 0x37, 0xaa, 0x41, 0xb2, 0xa9, + 0xbf, 0x36, 0x67, 0xb5, 0xe5, 0x12, 0xb6, 0x58, 0x62, 0x63, 0xf6, 0x12, 0x8b, 0x25, 0x32, 0xca, + 0x25, 0x2a, 0x08, 0x72, 0x61, 0x10, 0x58, 0x30, 0x43, 0x17, 0x86, 0x78, 0x4e, 0xf7, 0xa2, 0x08, + 0xe8, 0x55, 0xb8, 0xda, 0x72, 0x89, 0xc3, 0xfc, 0xa1, 0x30, 0x7f, 0x4a, 0xf2, 0x94, 0xc5, 0x84, + 0xad, 0xb0, 0xff, 0x2e, 0x94, 0x7a, 0x83, 0x76, 0xc8, 0x37, 0x2d, 0xf9, 0x8a, 0x94, 0x1a, 0x30, + 0xdd, 0x50, 0x48, 0xc0, 0xc0, 0xb8, 0x44, 0x67, 0xc5, 0x10, 0xbf, 0x05, 0x73, 0x91, 0xbd, 0x32, + 0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f5, + 0x4c, 0xe4, 0x88, 0xd1, 0xbb, 0x42, 0x8f, 0xe8, 0x01, 0xca, 0x11, 0xcb, 0xf4, 0x59, 0x37, 0x70, + 0xab, 0xdf, 0x26, 0x2f, 0xf8, 0x9b, 0x36, 0x6f, 0x87, 0x04, 0x9e, 0x9c, 0xcb, 0x5e, 0x21, 0xaf, + 0xd6, 0xf4, 0xde, 0x21, 0xbd, 0xe4, 0xb5, 0x91, 0x7f, 0xd2, 0xe8, 0xb3, 0x36, 0x99, 0xda, 0xe1, + 0x22, 0x20, 0x46, 0xac, 0x77, 0x3c, 0x9d, 0xda, 0x80, 0x05, 0x46, 0xa5, 0xf7, 0x9e, 0xa6, 0xee, + 0x21, 0x62, 0x28, 0xd8, 0xce, 0xc4, 0x60, 0xdb, 0xf1, 0xbc, 0xe7, 0x03, 0xb7, 0x2d, 0xb7, 0x16, + 0x8c, 0x71, 0x5d, 0x08, 0x7f, 0xea, 0x45, 0x80, 0xf9, 0xab, 0x4a, 0x79, 0x14, 0x4a, 0x79, 0x4c, + 0xfc, 0x09, 0x52, 0xf0, 0xeb, 0x70, 0x5d, 0x71, 0xca, 0x8a, 0x7d, 0x02, 0xf3, 0x1e, 0xdc, 0x52, + 0xcc, 0x9b, 0x27, 0x2c, 0xad, 0x7c, 0x22, 0x15, 0xfe, 0xaf, 0x76, 0x6e, 0x40, 0x25, 0xb0, 0x93, + 0xe7, 0x20, 0x83, 0xae, 0x6e, 0xc0, 0xc8, 0x93, 0x77, 0x86, 0xca, 0x62, 0xcf, 0x8c, 0xe6, 0x52, + 0x16, 0xf5, 0x12, 0x64, 0xcf, 0x78, 0x13, 0x96, 0x94, 0x0c, 0x99, 0x1d, 0x44, 0x85, 0x8c, 0x19, + 0x64, 0x12, 0x22, 0x1d, 0xc6, 0x96, 0x4e, 0x76, 0xbb, 0xce, 0x19, 0x75, 0x2d, 0x97, 0x99, 0xd1, + 0x64, 0x5e, 0x17, 0x37, 0x82, 0x19, 0xa6, 0x83, 0xb6, 0x24, 0x33, 0x01, 0x3a, 0x59, 0x1e, 0x04, + 0x23, 0x8f, 0x1d, 0xc4, 0x98, 0xe8, 0xef, 0xc3, 0x4a, 0x60, 0x04, 0xf3, 0xdb, 0x13, 0x7a, 0x59, + 0x3b, 0x9e, 0xa7, 0x95, 0x9c, 0xa6, 0x8d, 0x3f, 0x80, 0xfc, 0x90, 0x48, 0x4c, 0x29, 0xae, 0xa3, + 0x35, 0xd1, 0xd1, 0x5f, 0xd3, 0x16, 0xf3, 0x79, 0xdc, 0x86, 0xdb, 0x4a, 0xba, 0xf0, 0xa8, 0x51, + 0x7c, 0xdc, 0x28, 0x55, 0x8e, 0x08, 0xb7, 0x8e, 0x97, 0x23, 0x39, 0x71, 0xf6, 0x41, 0x63, 0xf1, + 0x03, 0xe1, 0x48, 0x15, 0x5b, 0xa9, 0xde, 0x15, 0xdb, 0xc2, 0xa7, 0x41, 0x48, 0xa6, 0x12, 0x76, + 0x04, 0x8b, 0xd1, 0x48, 0x4e, 0x05, 0x63, 0x34, 0xeb, 0xf5, 0xa9, 0x0b, 0x15, 0x88, 0x89, 0x81, + 0x32, 0x38, 0x08, 0xf3, 0x54, 0x06, 0x3b, 0xa1, 0x30, 0x7e, 0x25, 0xd3, 0xda, 0xcb, 0x4e, 0x53, + 0xe5, 0x33, 0x62, 0x80, 0x77, 0xe1, 0x46, 0x1c, 0x26, 0x52, 0x99, 0x7c, 0x20, 0x2e, 0xb0, 0x09, + 0x49, 0x52, 0xc9, 0xfd, 0x28, 0x04, 0x03, 0x0d, 0x50, 0x52, 0x89, 0xb4, 0xc1, 0x32, 0xe1, 0xcb, + 0xff, 0xe3, 0xbe, 0x06, 0x70, 0x93, 0x4a, 0x98, 0x17, 0x0a, 0x4b, 0x7f, 0xfc, 0x21, 0x46, 0xe4, + 0x26, 0x62, 0x84, 0x0c, 0x92, 0x10, 0xc5, 0xbe, 0x86, 0x4b, 0x27, 0x75, 0x84, 0x00, 0x9a, 0x56, + 0x07, 0x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, + 0x23, 0x91, 0xb8, 0x60, 0xa8, 0xd6, 0xd1, 0x1b, 0x09, 0x3e, 0x35, 0xb6, 0x5b, 0xad, 0x37, 0x2f, + 0xc9, 0x3d, 0x39, 0x02, 0xc4, 0x69, 0xa8, 0x08, 0xf8, 0x4d, 0x06, 0x16, 0x4d, 0xe5, 0x3e, 0x4a, + 0x50, 0x96, 0xd0, 0xab, 0xb5, 0xd6, 0x2e, 0xcb, 0x7e, 0x09, 0xbf, 0x05, 0x31, 0xb1, 0x51, 0xfa, + 0xc3, 0xdf, 0x56, 0x32, 0x5f, 0xd2, 0x7f, 0x7f, 0xa5, 0xff, 0x8e, 0xa6, 0xf9, 0x6f, 0xbe, 0xdf, + 0xfe, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9d, 0xf9, 0x46, 0x39, 0x7a, 0x2e, 0x00, 0x00, } diff --git a/etcdserver/etcdserverpb/rpc.proto b/etcdserver/etcdserverpb/rpc.proto index 8330d9ad7..67564d5fe 100644 --- a/etcdserver/etcdserverpb/rpc.proto +++ b/etcdserver/etcdserverpb/rpc.proto @@ -558,6 +558,15 @@ message WatchCreateRequest { // wish to recover a disconnected watcher starting from a recent known revision. // The etcd server may decide how often it will send notifications based on current load. bool progress_notify = 4; + + enum FilterType { + // filter out put event. + NOPUT = 0; + // filter out delete event. + NODELETE = 1; + } + // filters filter the events at server side before it sends back to the watcher. + repeated FilterType filters = 5; } message WatchCancelRequest { diff --git a/integration/v3_watch_test.go b/integration/v3_watch_test.go index a3181506c..08cb565c9 100644 --- a/integration/v3_watch_test.go +++ b/integration/v3_watch_test.go @@ -1011,3 +1011,71 @@ func TestV3WatchClose(t *testing.T) { clus.Members[0].DropConnections() wg.Wait() } + +// TestV3WatchWithFilter ensures watcher filters out the events correctly. +func TestV3WatchWithFilter(t *testing.T) { + clus := NewClusterV3(t, &ClusterConfig{Size: 1}) + defer clus.Terminate(t) + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + + ws, werr := toGRPC(clus.RandClient()).Watch.Watch(ctx) + if werr != nil { + t.Fatal(werr) + } + req := &pb.WatchRequest{RequestUnion: &pb.WatchRequest_CreateRequest{ + CreateRequest: &pb.WatchCreateRequest{ + Key: []byte("foo"), + Filters: []pb.WatchCreateRequest_FilterType{pb.WatchCreateRequest_NOPUT}, + }}} + if err := ws.Send(req); err != nil { + t.Fatal(err) + } + if _, err := ws.Recv(); err != nil { + t.Fatal(err) + } + + recv := make(chan *pb.WatchResponse) + go func() { + // check received PUT + resp, rerr := ws.Recv() + if rerr != nil { + t.Fatal(rerr) + } + recv <- resp + }() + + // put a key with empty value + kvc := toGRPC(clus.RandClient()).KV + preq := &pb.PutRequest{Key: []byte("foo")} + if _, err := kvc.Put(context.TODO(), preq); err != nil { + t.Fatal(err) + } + + select { + case <-recv: + t.Fatal("failed to filter out put event") + case <-time.After(100 * time.Millisecond): + } + + dreq := &pb.DeleteRangeRequest{Key: []byte("foo")} + if _, err := kvc.DeleteRange(context.TODO(), dreq); err != nil { + t.Fatal(err) + } + + select { + case resp := <-recv: + wevs := []*mvccpb.Event{ + { + Type: mvccpb.DELETE, + Kv: &mvccpb.KeyValue{Key: []byte("foo"), ModRevision: 3}, + }, + } + if !reflect.DeepEqual(resp.Events, wevs) { + t.Fatalf("got %v, expected %v", resp.Events, wevs) + } + case <-time.After(100 * time.Millisecond): + t.Fatal("failed to receive delete event") + } +} diff --git a/mvcc/watchable_store.go b/mvcc/watchable_store.go index 8339500ec..dbb79bcb6 100644 --- a/mvcc/watchable_store.go +++ b/mvcc/watchable_store.go @@ -35,7 +35,7 @@ const ( ) type watchable interface { - watch(key, end []byte, startRev int64, id WatchID, ch chan<- WatchResponse) (*watcher, cancelFunc) + watch(key, end []byte, startRev int64, id WatchID, ch chan<- WatchResponse, fcs ...FilterFunc) (*watcher, cancelFunc) progress(w *watcher) rev() int64 } @@ -185,7 +185,7 @@ func (s *watchableStore) NewWatchStream() WatchStream { } } -func (s *watchableStore) watch(key, end []byte, startRev int64, id WatchID, ch chan<- WatchResponse) (*watcher, cancelFunc) { +func (s *watchableStore) watch(key, end []byte, startRev int64, id WatchID, ch chan<- WatchResponse, fcs ...FilterFunc) (*watcher, cancelFunc) { s.mu.Lock() defer s.mu.Unlock() @@ -195,6 +195,7 @@ func (s *watchableStore) watch(key, end []byte, startRev int64, id WatchID, ch c minRev: startRev, id: id, ch: ch, + fcs: fcs, } s.store.mu.Lock() @@ -325,10 +326,9 @@ func (s *watchableStore) moveVictims() (moved int) { for w, eb := range wb { // watcher has observed the store up to, but not including, w.minRev rev := w.minRev - 1 - select { - case w.ch <- WatchResponse{WatchID: w.id, Events: eb.evs, Revision: rev}: + if w.send(WatchResponse{WatchID: w.id, Events: eb.evs, Revision: rev}) { pendingEventsGauge.Add(float64(len(eb.evs))) - default: + } else { if newVictim == nil { newVictim = make(watcherBatch) } @@ -419,10 +419,9 @@ func (s *watchableStore) syncWatchers() { w.minRev = eb.moreRev } - select { - case w.ch <- WatchResponse{WatchID: w.id, Events: eb.evs, Revision: curRev}: + if w.send(WatchResponse{WatchID: w.id, Events: eb.evs, Revision: curRev}) { pendingEventsGauge.Add(float64(len(eb.evs))) - default: + } else { if victims == nil { victims = make(watcherBatch) } @@ -480,10 +479,10 @@ func (s *watchableStore) notify(rev int64, evs []mvccpb.Event) { if eb.revs != 1 { plog.Panicf("unexpected multiple revisions in notification") } - select { - case w.ch <- WatchResponse{WatchID: w.id, Events: eb.evs, Revision: rev}: + + if w.send(WatchResponse{WatchID: w.id, Events: eb.evs, Revision: rev}) { pendingEventsGauge.Add(float64(len(eb.evs))) - default: + } else { // move slow watcher to victims w.minRev = rev + 1 if victim == nil { @@ -516,12 +515,9 @@ func (s *watchableStore) progress(w *watcher) { defer s.mu.Unlock() if _, ok := s.synced.watchers[w]; ok { - select { - case w.ch <- WatchResponse{WatchID: w.id, Revision: s.rev()}: - default: - // If the ch is full, this watcher is receiving events. - // We do not need to send progress at all. - } + w.send(WatchResponse{WatchID: w.id, Revision: s.rev()}) + // If the ch is full, this watcher is receiving events. + // We do not need to send progress at all. } } @@ -542,7 +538,40 @@ type watcher struct { minRev int64 id WatchID + fcs []FilterFunc // a chan to send out the watch response. // The chan might be shared with other watchers. ch chan<- WatchResponse } + +func (w *watcher) send(wr WatchResponse) bool { + progressEvent := len(wr.Events) == 0 + + if len(w.fcs) != 0 { + ne := make([]mvccpb.Event, 0, len(wr.Events)) + for i := range wr.Events { + filtered := false + for _, filter := range w.fcs { + if filter(wr.Events[i]) { + filtered = true + break + } + } + if !filtered { + ne = append(ne, wr.Events[i]) + } + } + wr.Events = ne + } + + // if all events are filtered out, we should send nothing. + if !progressEvent && len(wr.Events) == 0 { + return true + } + select { + case w.ch <- wr: + return true + default: + return false + } +} diff --git a/mvcc/watcher.go b/mvcc/watcher.go index 9353f8356..abd8e73e4 100644 --- a/mvcc/watcher.go +++ b/mvcc/watcher.go @@ -27,6 +27,9 @@ var ( type WatchID int64 +// FilterFunc returns true if the given event should be filtered out. +type FilterFunc func(e mvccpb.Event) bool + type WatchStream interface { // Watch creates a watcher. The watcher watches the events happening or // happened on the given key or range [key, end) from the given startRev. @@ -37,7 +40,7 @@ type WatchStream interface { // The returned `id` is the ID of this watcher. It appears as WatchID // in events that are sent to the created watcher through stream channel. // - Watch(key, end []byte, startRev int64) WatchID + Watch(key, end []byte, startRev int64, fcs ...FilterFunc) WatchID // Chan returns a chan. All watch response will be sent to the returned chan. Chan() <-chan WatchResponse @@ -95,7 +98,7 @@ type watchStream struct { // Watch creates a new watcher in the stream and returns its WatchID. // TODO: return error if ws is closed? -func (ws *watchStream) Watch(key, end []byte, startRev int64) WatchID { +func (ws *watchStream) Watch(key, end []byte, startRev int64, fcs ...FilterFunc) WatchID { ws.mu.Lock() defer ws.mu.Unlock() if ws.closed { @@ -105,7 +108,7 @@ func (ws *watchStream) Watch(key, end []byte, startRev int64) WatchID { id := ws.nextID ws.nextID++ - w, c := ws.watchable.watch(key, end, startRev, id, ws.ch) + w, c := ws.watchable.watch(key, end, startRev, id, ws.ch, fcs...) ws.cancels[id] = c ws.watchers[id] = w diff --git a/mvcc/watcher_test.go b/mvcc/watcher_test.go index cf4c740a9..3fc78e01c 100644 --- a/mvcc/watcher_test.go +++ b/mvcc/watcher_test.go @@ -283,3 +283,40 @@ func TestWatcherRequestProgress(t *testing.T) { t.Fatal("failed to receive progress") } } + +func TestWatcherWatchWithFilter(t *testing.T) { + b, tmpPath := backend.NewDefaultTmpBackend() + s := WatchableKV(newWatchableStore(b, &lease.FakeLessor{}, nil)) + defer cleanup(s, b, tmpPath) + + w := s.NewWatchStream() + defer w.Close() + + filterPut := func(e mvccpb.Event) bool { + return e.Type == mvccpb.PUT + } + + w.Watch([]byte("foo"), nil, 0, filterPut) + done := make(chan struct{}) + + go func() { + <-w.Chan() + done <- struct{}{} + }() + + s.Put([]byte("foo"), []byte("bar"), 0) + + select { + case <-done: + t.Fatal("failed to filter put request") + case <-time.After(100 * time.Millisecond): + } + + s.DeleteRange([]byte("foo"), nil) + + select { + case <-done: + case <-time.After(100 * time.Millisecond): + t.Fatal("failed to receive delete request") + } +}