926 Commits

Author SHA1 Message Date
Xiang Li
128b5e7387 etcdserver: check invalid range in txn 2016-01-25 20:21:17 -08:00
Xiang Li
ef6320e638 etcdserver: make cluster checking interval shorter 2016-01-25 08:16:05 +08:00
Xiang Li
1aa312fcce *: lease forwarding should resue transport 2016-01-25 06:56:07 +08:00
Xiang Li
5e2dbadbc0 leasehttp: move lease/http.go to its own pkg 2016-01-25 06:09:54 +08:00
Anthony Romano
9572197aee etcdserver: return error when putting a key with a bad lease id 2016-01-22 20:47:31 -08:00
Anthony Romano
2e157530a0 etcdhttp, lease, v3api: forward keepalives to leader
keepalives don't go through raft so let follower peers announce
keepalives to the leader through the peer http handler
2016-01-22 12:40:40 -08:00
Anthony Romano
9113a27bde lease: grant consistent lease IDs
When raft broadcasts a Grant to all nodes, all nodes must
agree on the same lease ID. Otherwise, attaching a key to
a lease will fail since the lease ID is node-dependent.
2016-01-22 09:43:39 -08:00
Anthony Romano
ccfd68a251 etcdserver: support Revision option in v3 RangeRequest 2016-01-17 21:45:22 -08:00
Anthony Romano
8df3f0c545 etcdserver: support 'More' flag for v3 RangeRequest 2016-01-17 21:45:22 -08:00
Gyu-Ho Lee
b6077f9d57 *: fix minor typos 2016-01-14 01:28:29 -08:00
Hitoshi Mitake
588f655b4e etcdmain: add an option for pprof
This commit adds a new option for activating profiling based on pprof
in etcd process.
 - -enable-pprof: boolean type option which activates profiling

For example, if a client URL is http://localhost:12379, users and
developers access heap profiler with this URL:
http://localhost:12379/debug/pprof/heap
2016-01-13 16:12:26 +09:00
Anthony Romano
efa9cd7e0c Merge pull request #4184 from heyitsanthony/v3-rangereq-sort
etcdserver: support sorted range requests in v3 api
2016-01-12 10:26:52 -08:00
Anthony Romano
82eeffbd58 etcdserver: support sorted range requests in v3 api
Fixes #4166
2016-01-12 10:08:30 -08:00
Xiang Li
6b1d9fb7ce *: stop lessor when etcdserver is stopped 2016-01-12 10:06:11 -08:00
Xiang Li
59bf83c7f4 *: now lease keepAlive works on leader 2016-01-09 22:12:02 -08:00
Xiang Li
f5753f2f51 *: support lease Attach
Now we can attach keys to leases. And revoking the lease removes all
the attached keys of that lease.
2016-01-09 11:01:58 -08:00
Xiang Li
2566699a48 *: revoke expired leases 2016-01-08 13:37:58 -08:00
Xiang Li
7de0e9130c Merge pull request #4167 from xiang90/lease_promote
*: expose Lessor Promote and Demote interface
2016-01-08 10:38:08 -08:00
Gyu-Ho Lee
f76166a041 *: fix minor typos 2016-01-08 00:21:19 -08:00
Xiang Li
f5fa9b5384 *: expose Lessor Promote and Demote interface 2016-01-07 18:18:20 -08:00
Xiang Li
99bee2fd29 Merge pull request #4162 from xiang90/lease
*: add support for lease create and revoke
2016-01-07 16:58:59 -08:00
Xiang Li
d9ca929a33 *: add support for lease create and revoke
Basic support for lease operations like create and revoke.
We still need to:
1. attach keys to leases in KV implmentation if lease field is set
2. leader periodically removes expired leases
3. leader serves keepAlive requests and follower forwards keepAlive
requests to leader.
2016-01-07 16:39:39 -08:00
Gyu-Ho Lee
5842177172 etcdserver/api/v3rpc: fill in KV ResponseHeader 2016-01-07 12:18:31 -08:00
Xiang Li
43a777b7a2 *: get snapshot from backend
We should get snapshot from backend, not just KV.
We plan to store the lease data into backend too.
2016-01-06 22:40:23 -08:00
Xiang Li
1714290f4e storage: support recovering from backend
We want the KV to support recovering from backend to avoid
additional pointer swap. Or we have to do coordination between
etcdserver and API layer, since API layer might have access to
kv pointer and use a closed kv.
2016-01-06 21:16:55 -08:00
Gyu-Ho Lee
366e7a879f *: fill in WatchResponse.Header
Related to coreos#3848.
2016-01-06 15:12:53 -08:00
Xiang Li
5dd3f91903 *: make backend outside kv
KV and lease will share the same backend. Thus we need to make
backend outside KV.
2016-01-05 19:55:29 -08:00
Xiang Li
1e61243fd7 Merge pull request #4134 from xiang90/lease
lease: modify API and persist lease to disk
2016-01-05 10:30:52 -08:00
Xiang Li
09b420f08c *: move leaseID typedef to lease pkg 2016-01-05 10:18:17 -08:00
Anthony Romano
838328b057 etcdserver: fix racey WaitSchedule() tests to wait for recorder actions
Fixes #4119
2016-01-05 09:39:18 -08:00
Anthony Romano
384cc76299 pkg/testutil: make Recorder an interface
Provides two implementations of Recorder-- one that is non-blocking
like the original version and one that provides a blocking channel
to avoid busy waiting or racing in tests when no other synchronization
is available.
2016-01-05 09:39:18 -08:00
Anthony Romano
e1bf726bc1 *: split out etcdserver's test mockup objects to live in interfaces' packages 2016-01-05 09:39:13 -08:00
Anthony Romano
21a6ade53d storage: change type of WatchIDs from int64 to WatchID 2016-01-04 19:52:22 -08:00
Gyu-Ho Lee
556d4a6932 *: remove CancelFunc return for Watch. Use Cancel for watch. 2016-01-04 16:17:55 -08:00
Xiang Li
4336278b44 *: support put with lease 2016-01-04 15:54:06 -08:00
Gyu-Ho Lee
6540f47dfa *: WatchResponse for multiple Events with WatchID
storage/storagepb: remove watchID from Event

storage: add WatchResponse to watcher.go to wrap events, watchID

storage: watchableStore to use WatchResponse

storage: kv_test with WatchResponse

etcdserver/api/v3rpc: watch to receive storage.WatchResponse type
2016-01-03 16:32:48 -08:00
Xiang Li
eda0eefc25 *: support watcher cancellation inside watchStream 2016-01-03 00:20:21 -08:00
Xiang Li
ec12686233 v3api: add support for sending watcher control response 2016-01-02 22:31:22 -08:00
Xiang Li
ee0b3f42ed *: rename watcher to watchStream
Watcher vs Watching in storage pkg is confusing. Watcher should be named
as watchStream since it contains a channel as stream to send out events.
Then we can rename watching to watcher, which actually watches on a key
and send watched events through watchStream.

This commits renames watcher to watchStram.
2016-01-02 16:03:57 -08:00
Xiang Li
ac330bb7c9 *: update watch related proto
1. Add watch/cancel request
2. Add necessary fields in response to return watch error
3. Add watch_id into watch response
2016-01-01 10:22:21 -08:00
Gyu-Ho Lee
8f03c600b5 etcdserver/api/v3rpc: watch.go with events slice 2015-12-31 19:25:15 -08:00
Gyu-Ho Lee
8da6e76588 etcdserver/etcdserverpb: rpc WatchResponse with events slice 2015-12-31 19:24:46 -08:00
Xiang Li
1dc0e664f0 *: fix proto and regenerate all go files 2015-12-30 20:11:19 -08:00
Gyu-Ho Lee
f19a07289a Merge pull request #4098 from gyuho/merge_log
*: use merge logger for repeating etcdserver error logs
2015-12-29 21:23:30 -07:00
Anthony Romano
8346a7c052 Merge pull request #4094 from heyitsanthony/send-merged-done-nowait
etcdserver: respect done channel when sleeping for snapshot backoff
2015-12-29 20:18:08 -08:00
Gyu-Ho Lee
8f943f2f45 etcdserver/etcdhttp: use MergeLogger to log etcdserver errors
Related https://github.com/coreos/etcd/issues/3812.
2015-12-29 20:00:52 -08:00
Anthony Romano
942b5570bd Merge pull request #4096 from heyitsanthony/serialize-applier-snapmerge
etcdserver: serialize snapshot merger with applier
2015-12-29 19:37:11 -08:00
Anthony Romano
4cd86ae1ef etcdserver: serialize snapshot merger with applier
Avoids inconsistent snapshotting by only attempting to
create a snapshot after an apply completes.

Fixes #4061
2015-12-29 18:38:39 -08:00
Anthony Romano
c7c3bda8b9 etcdserver: respect done channel when sleeping for snapshot backoff 2015-12-29 13:23:41 -08:00
Xiang Li
9d9680121c etcdserver/etcdserverpb: make rpc.proto updated 2015-12-29 12:58:14 -08:00