Commit Graph

11 Commits (1c04820026881bcf93ff00d255f8666306ca1789)

Author SHA1 Message Date
Hitoshi Mitake e8c18e3368 proxy: handle authed snapshot request in grpcproxy
Like the previous commit 10f783efdd12, this commit lets grpcproxy
forward an auth token supplied by its client in an explicit
manner. snapshot is a stream RPC so this process is required like
watch.
2017-09-20 15:27:27 +09:00
Hitoshi Mitake 94b5071c30 etcdmain, proxy: handle authed watch in grpcproxy
This commit lets grpcproxy handle authed watch. The main changes are:
1. forwrading a token of a new broadcast client
2. checking permission of a new client that participates to an
   existing broadcast
2017-09-20 15:27:26 +09:00
Gyu-Ho Lee f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Anthony Romano e42fa18ccf grpcproxy: don't use WithRequireLeader for watch event stream
Ohterwise leader loss will reject all stream creation.
2017-02-02 09:32:25 -08:00
Gyu-Ho Lee 7e74b3f846 grpcproxy: remove unused field 'wbs *watchBroadcasts' 2016-12-12 10:07:14 -08:00
Anthony Romano 91ff6f30b5 grpcproxy: fix deadlock in watchbroadcast
Calling empty() in watchbroadcast methods was trying to
lock the rwmutex when it was already held.

Fixes #6937
2016-12-05 15:06:44 -08:00
Xiang Li a686c994cd grpcproxy: add richer metrics for watch 2016-12-02 11:13:30 -08:00
Anthony Romano 98a7c642d4 grpcproxy: watch next revision should be start revision when not 0
The create header revision is the current etcd revision. For watches with
rev=0, the next revision is hdr.rev+1. For watches with rev=n, the next
revision should be n.

Fixes TestDoubleBarrier timeouts.
2016-11-14 16:46:02 -08:00
Anthony Romano 90ea3fbadc grpcproxy: do not resend create event after leader loss
Only set CreateNotify if no watch responses have been received.
2016-11-14 10:43:06 -08:00
Anthony Romano 6604306398 grpcproxy: support prevKV watcher
Makes all server watchers PrevKV, discards if client watcher is not PrevKV.
2016-11-11 14:22:06 -08:00
Anthony Romano ec459c2185 grpcproxy: rework watcher organization
The single watcher / group watcher distinction limited and
complicated watcher coalescing more than necessary. Reworked:

Each server watcher is represented by a WatchBroadcast, each
client "Watcher" attaches to some WatchBroadcast. WatchBroadcasts
hold all WatchBroadcast instances for a range. WatchRanges holds
all WatchBroadcasts for the proxy.

WatchProxyStreams represent a grpc watch stream between the proxy and
a client. When a client requests a new watcher through its grpc stream,
the ProxyStream will allocate a Watcher and WatchRanges assigns it to
some WatchBroadcast based on its range.

Coalescing is done by WatchBroadcasts when it receives an update
notification from a WatchBroadcast.

Supports leader failure detection so watches on a bad member
can migrate to other members. Coincidentally, Fixes #6303.
2016-11-11 10:14:35 -08:00