Gyu-Ho Lee
0199bdc266
*: fix 'ineffassign' issues
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-10-03 10:14:33 -07:00
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
Hitoshi Mitake
e709f83253
etcdmain, proxy: support authed RPCs with grpcproxy
...
This commit lets grpcproxy support authed RPCs. Auth tokens supplied
by clients are now forwarded to etcdserver by grpcproxy.
2017-09-20 11:14:45 +09:00
Anthony Romano
7f4464415a
grpcproxy: respect KeysOnly flag
...
Fixes #8478
2017-09-13 09:57:08 -07:00
Gyu-Ho Lee
6f76d52a1a
*: deprecate grpc.Code, grpc.ErrorDesc
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-11 09:28:56 -07: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
Gyu-Ho Lee
f8141db2c7
proxy/grpcproxy: implement LeaseLeases API
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-14 14:18:56 -07:00
Anthony Romano
6a4194c556
grpcproxy: forward PrevKv flag in Put
2017-08-03 21:38:20 -07:00
Gyu-Ho Lee
cd37ef2c1b
*: expose etcdhttp.Health, define proxy health handler
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-07-31 14:07:54 -07:00
Gyu-Ho Lee
8a589d2d73
grpcproxy/cluster_test: serve grpc server after register service
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-07-27 10:47:24 -07:00
Xiang Li
2a348fb8e9
Merge pull request #8263 from fanminshi/hash_by_rev
...
api: hash by rev
2017-07-26 11:22:33 -07:00
fanmin shi
a6ae677d8f
proxy: support HashKV in grpcproxy
2017-07-25 17:00:56 -07:00
Anthony Romano
9581f7676c
grpcproxy: forward Canceled field when broadcasting watch responses
2017-07-25 12:36:01 -07:00
Xiang Li
fe33bd1879
Merge pull request #8294 from mitake/proxy-cachemiss
...
proxy: don't inc a cache miss count in a case of linearizable range
2017-07-24 20:47:19 -07:00
Anthony Romano
1dcae41b20
grpcproxy: return nil on receiving snapshot EOF
...
Gets "code = OutOfRange desc = EOF" errors otherwise.
2017-07-21 11:00:22 -07:00
Hitoshi Mitake
488df4db34
proxy: don't inc a cache miss count in a case of linearizable range
...
Requests of linearizable range don't touch the cache of grpcproxy. So
incrementing the miss count wouldn't be meaningful.
2017-07-20 21:51:10 -07:00
Gyu-Ho Lee
3e263d5a4d
proxy/*: add 'MoveLeader' RPC
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-23 12:51:27 -07:00
Anthony Romano
f465e3ea8a
grpcproxy: support nested txns
2017-06-21 14:33:15 -07:00
Xiang Li
a65e3c69a6
Merge pull request #8122 from yudai/fast_fail_proxy
...
grpcproxy: Disable fast fail on lease grant call to cluster
2017-06-19 15:04:25 -07:00
Iwasaki Yudai
df2cc4bc8c
grpcproxy: Disable fast fail on lease grant call to cluster
...
Problem Observed
----------------
When there is no etcd process behind the proxy,
clients repeat resending lease grant requests without delay.
This behavior can cause abnormal resource consumption on CPU/RAM and
network.
Problem Detail
--------------
`LeaseGrant()` uses a bare protobuf client to forward requests.
However, it doesn't use `grpc.FailFast(false)`, which means the method returns
an `Unavailable` error immediately when no etcd process is available.
In clientv3, `Unavailable` errors are not considered the "Halt" error,
and library retries the request without delay.
Both clients and the proxy consume much CPU cycles to process retry requests.
Resolution
----------
Add `grpc.FailFast(false))` to `LeaseGrant()` of the `leaseProxy`.
This makes the proxy not to return immediately when no etcd process is
available. Clients will simply timeout requests instead.
2017-06-16 15:09:05 -07:00
Anthony Romano
aeb2dc03aa
grpcproxy: invalidate cache on comparison range
2017-06-16 12:13:27 -07:00
Gyu-Ho Lee
5e059fd8dc
*: use metadata Incoming/OutgoingContext
...
Fix https://github.com/coreos/etcd/issues/7888 .
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-15 16:41:23 -07:00
Nikola Kovacs
66687da3ba
*: grammar fixes, it's -> its
2017-06-15 18:23:16 +02:00
Anthony Romano
5bb0a091fc
adapter: auth server to client adapter
2017-06-09 09:36:16 -07:00
Anthony Romano
33c375dc44
*: fill out blank package godocs
...
Mostly one-liner short descriptions, but also includes some typo fixes
and some examples.
2017-05-18 09:41:13 -07:00
Anthony Romano
5bd9b9614f
tcpproxy: display endpoints, not pointers, in ready to proxy string
...
The switch to *net.SRV for endpoints caused the ready string to emit
pointers instead of endpoint strings.
Fixes #7942
2017-05-17 10:51:35 -07:00
Anthony Romano
713e006bc6
adpater: adapters for lock and election services
2017-05-10 12:51:05 -07:00
Anthony Romano
fd01db9e60
grpcproxy, etcdmain: add lock and election services to proxy
2017-05-10 12:19:09 -07:00
Anthony Romano
c232814003
etcdmain, tcpproxy: srv-priority policy
...
Adds DNS SRV weighting and priorities to gateway.
Partially addresses #4378
2017-05-08 11:35:18 -07:00
Anthony Romano
6dd8fb6f24
Revert "Merge pull request #7732 from heyitsanthony/lease-err-ka"
...
This reverts commit fbbc4a4979b256125d2238f6325ad86e7f1b58bd, reversing
changes made to f254e383859a2939d5929346f6595549f424f7c5.
Fixes #7851
2017-05-02 09:36:16 -07:00
Anthony Romano
b5384ac1c0
grpcproxy: use new lease interface
2017-04-24 23:49:44 -07:00
Gyu-Ho Lee
7adf4d7c94
grpcproxy/adapter: add Cluster API support
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-04-04 08:13:30 -07:00
Gyu-Ho Lee
5c642ae314
grpcproxy/adapter: add maintenance API support
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-28 09:09:06 -07:00
Gyu-Ho Lee
caa73c176f
proxy/grpcproxy: add chanStream helper
...
Prelimiary work for maintenance API in adapter
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-27 11:24:02 -07:00
Anthony Romano
b2a465e354
grpcproxy/cache: only check compaction revision for historical revisions
...
Since the current revision is 0, it'll always be less than the compaction
revision. If the proxy sees a compaction, it would always reject the
current revision requests since it's less than the compaction revision.
Instead, check if the revision is historical before trying to reject on
compaction revision.
Fixes #7599
2017-03-24 13:20:46 -07:00
Anthony Romano
b025cdd097
adapter, integration: split out grpc adapters from grpcproxy package
...
Break cyclic dependency:
clientv3/naming <-> integration <-> v3client <-> grpcproxy <-> clientv3/naming
2017-03-13 15:23:26 -07:00
Gyu-Ho Lee
f862b47e92
grpcproxy: configure register to Cluster API
...
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-09 02:40:13 -08:00
Anthony Romano
28e9ba365a
grpcproxy: return closing error when stream is canceled from conn close
...
Fixes #6630
2017-03-01 16:46:13 -08:00
Gyu-Ho Lee
72a531e8b2
grpcproxy: add 'register' address
...
For https://github.com/coreos/etcd/issues/6902 .
2017-02-22 16:47:48 -08:00
Anthony Romano
25403970f5
Merge pull request #7361 from heyitsanthony/fix-gateway-goroutine
...
tcpproxy: don't use range variable in reactivate goroutine
2017-02-21 13:26:53 -08:00
Anthony Romano
8b097f279d
tcpproxy: don't use range variable in reactivate goroutine
...
Ends up trying to reactivate only the last endpoint.
2017-02-21 12:39:49 -08:00
Anthony Romano
29a6fd65ad
grpcproxy: only return ctx error in chan stream if recvc is empty
...
Since select{} won't prioritize, ctx.Done() can sometimes override
a pending message on recvc. Loop if recvc has messages instead.
Fixes #7340
2017-02-21 10:53:58 -08:00
fanmin shi
ba52bd07ba
grpcproxy: add lease coalescing support
2017-02-16 11:50:50 -08:00
fanmin shi
05b82f2022
grpcproxy: refactor chan stream out of watch_client_adapter
2017-02-16 11:41:21 -08:00
Anthony Romano
80de75431e
grpcproxy: support forcing leader as available
...
Leadership timeout can sometimes take too long, such as in test cases.
However, it is possible to infer a leader is available based on RPCs
that must go through consensus. Therefore, have a way to update the
leadership status off the watch path.
2017-02-15 16:49:41 -08:00
Anthony Romano
36f5b713bf
grpcproxy: don't wait for ctx.Done() to close kv donec
...
Causes a goroutine leak in ActiveConnection.Close() tests. Channel is
vestigial since removing ccache; revisit if kv ever needs goroutines.
2017-02-15 00:16:25 -08:00
Anthony Romano
49a0a63fc3
grpcproxy: split out leadership detection code
...
Move out of watch code since will be shared with lease code. Also assumes
leader does not exist unless watch can be successfully created.
2017-02-15 00:16:25 -08:00
Anthony Romano
853f68071b
grpcproxy: respect CompactRevision in watcher
...
CompactRevision wasn't sent over watch stream, causing TestKVCompact to hang.
2017-02-13 15:43:41 -08:00
Anthony Romano
c22ba766d5
grpcproxy: support CountOnly
...
TestKVRange from client integration tests was failing.
2017-02-10 16:06:24 -08:00