Commit Graph

6366 Commits (769f874542fecb42877f47a9e9eb5a27df8c1c5a)

Author SHA1 Message Date
Yicheng Qin deb1da5f57 storage: add watch ID to identify watchings
One watcher includes multiple watchings, and their events are
sent out through one channel. For the received event, user would like to
know which watching it belongs to.

Introduce a watch ID. When watching on some key, user will get a watch
ID. The watch ID is attached to all events that is observed by this
watch.
2015-11-21 11:19:17 -08:00
Xiang Li 2de9a5bbd0 Merge pull request #3899 from gyuho/3859_synced_map
storage: use map for watchableStore synced
2015-11-21 08:06:00 -08:00
Gyu-Ho Lee 48aebd9b09 storage: use map for watchableStore synced
This is for coreos#3859 switching slice to map for synced watchings.
For a large amount of synced watchings, map implementation performs better.
When putting 1 million watchers on the same key and canceling them one by
one: original implementation takes 9m7.268221091s, while the one with map
takes only 430.531637ms.
2015-11-21 00:42:09 -08:00
Xiang Li 31574cb9da Merge pull request #3905 from xiang90/etcdctl_health
etcdctl: cluster health exit with non-zero when cluster is unhealthy
2015-11-20 14:38:18 -08:00
Xiang Li 37b34b334b Merge pull request #3887 from ypu/flags
etcdmain: Add max-snapshots and max-wals to help
2015-11-20 14:20:57 -08:00
Xiang Li a211ba3361 Merge pull request #3890 from gyuho/pipeline_full_message
rafthttp: more detailed logs when filled-up buffer
2015-11-20 14:09:34 -08:00
Xiang Li e39206e084 etcdctl: cluster health exit with non-zero when cluster is unhealthy 2015-11-20 13:51:31 -08:00
Jonathan Boulle 82b83cad43 Merge pull request #3904 from coreos/jonboulle-patch-2
MAINTAINERS: remove blake, fix xiang's handle
2015-11-20 13:30:46 -08:00
Jonathan Boulle 6fae5f5a0a MAINTAINERS: remove blake, fix xiang's handle 2015-11-20 13:26:45 -08:00
Xiang Li 11d00c7919 Merge pull request #3897 from xiang90/fix_watch
v3rpc: do not send closing event
2015-11-20 09:40:46 -08:00
Xiang Li b104df4b17 Merge pull request #3898 from mitake/get-quorum
etcdctl: a new option for quorum get
2015-11-20 08:08:49 -08:00
Xiang Li b868f4b1b1 v3rpc: report eventReceived correctly 2015-11-19 22:44:46 -08:00
Hitoshi Mitake 11f49a0960 etcdctl: a new option for quorum get
Current etcdctl seems to lack an option for specifying quorum flag for
GET. This commit adds the option.
2015-11-20 14:09:50 +09:00
Xiang Li 3cf90a4dff v3rpc: do not send closing event
When a watch stream closes, both of the watcher.Chan and closec
will be closed.

If watcher.Chan is closed, we should not send out the empty event.
Sending the empty is wrong and waste a lot of CPU resources.
Instead we should just return.
2015-11-19 17:56:15 -08:00
Xiang Li c400d05d0a Merge pull request #3892 from xiang90/fix_snapshot_handling
etcdserver: handle incoming v3 snapshot correctly
2015-11-19 12:18:18 -08:00
Xiang Li cf2d20c5c9 Merge pull request #3851 from yichengq/storage-kv-data
storage: save the KeyValue instead of Event in backend
2015-11-19 10:24:50 -08:00
Yicheng Qin 1214f77519 storage: set revBytes capacity to avoid malloc when appending mark
This is a performance optimization.
2015-11-19 09:53:31 -08:00
Jonathan Boulle f62e0ced9b Merge pull request #3893 from coreos/jonboulle-patch-1
docs/benchmarks: small fix in memory benchmark
2015-11-18 21:02:52 -08:00
Yiqiao Pu ddc4f8bd45 etcdmain: Add max-snapshots and max-wals to help
Based on the configuration doc, seems these two flags are missing
in the help. So add them and the descriptions are from config.go in
the same directory.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2015-11-19 11:58:00 +08:00
Jonathan Boulle 6f3ce70b46 docs/benchmarks: small fix in memory benchmark 2015-11-18 19:20:18 -08:00
Xiang Li a07e4bb6e2 etcdserver: handle incoming v3 snapshot correctly
1. we should update all kv reference (including the
on in snapStore).

2. we should first restore a new KV and then close
the old one asynchronously.
2015-11-18 16:07:41 -08:00
Gyu-Ho Lee 6aa559f93d rafthttp: more detailed logs when filled-up buffer
This adds more detailed explanation about why some messages got dropped to help
users debug. This is for https://github.com/coreos/etcd/issues/3806.
2015-11-18 14:17:43 -08:00
Jonathan Boulle 33065739df Merge pull request #3782 from gyuho/doc.go_for_package_description
*: add missing package descriptions
2015-11-18 11:32:37 -08:00
Gyu-Ho Lee 81229dbea9 *: add missing package descriptions
This adds and updates package descriptions in etcd projects.
And also deletes some duplicate LICENSE statements.
2015-11-17 20:54:10 -08:00
Yicheng Qin 2f74f76025 storage: remove the event concept from key-value layer
The point is to decouple the key-value storage layer and the
event notification layer clearly. It gives the watchableKV the
flexibility to define whatever event structure it wants without
breaking the ondisk format at key-value storage layer.

Changes:

1. change the format of key and value stored in backend

Store KeyValue struct instead of Event struct in backend value for
better abstraction as xiang suggests. And record the corresponded
action in the backend key.

2. Remove word 'event' from functions
2015-11-17 20:35:49 -08:00
Josh Wood c4672ced3e Merge pull request #3885 from joshix/prodready
README: Outright production-readiness
2015-11-17 18:18:16 -08:00
Josh Wood 833f0388cd README: Outright production-readiness
State outright that etcd is used in production and ready for more of same.

Supersedes #3884.

Adopt #3884 in spirit, but directly in README as jonboulle suggested.

Delete Documentation/production-ready.md.
2015-11-17 18:05:31 -08:00
Xiang Li 14c8a1c400 Merge pull request #3883 from gyuho/raft_typo
raft: minor typo in progress.go
2015-11-17 14:22:35 -08:00
Gyu-Ho Lee e1c108e604 raft: minor typo in progress.go
Fixes a minor typo.
2015-11-17 14:21:35 -08:00
Xiang Li db4dcbf827 Merge pull request #3881 from xiang90/godep
Godeps: add LICENSE file for ugorji/go
2015-11-17 13:38:06 -08:00
Xiang Li 0f339aaf2d godep: update godep 2015-11-17 13:18:24 -08:00
Xiang Li c0353697da Merge pull request #3880 from xiang90/fix_stop
etcdmain: fix unstoppable startEtcd function
2015-11-17 09:18:27 -08:00
Xiang Li 9e4a003fb0 etcdmain: fix unstoppable startEtcd function
We should wrap the blocking function with a closure. And first
creates a go routine to execute the function. Or the inner function
blocks before creating the go routine.
2015-11-17 09:04:00 -08:00
Xiang Li 8af76115cb Merge pull request #3873 from yichengq/func-long-timeout
tools/etcd-tester: extend timeout for stresser
2015-11-17 07:59:41 -08:00
Xiang Li 08dc70cc0f Merge pull request #3875 from xiang90/fix_txn
etcdserver: start real txn for txn request
2015-11-16 21:16:20 -08:00
Xiang Li b4abe5b584 etcdserver: start real txn for txn request
We should open real txn for applying txn requests. Or the intermediate
state might be observed by reader.

This also fixes #3803. Same consistent(raft) index per multiple indenpendent
operations confuses consistentStore.
2015-11-16 21:11:27 -08:00
Xiang Li 5d0268aa2e Merge pull request #3877 from bdarnell/campaign-while-leader
raft: no-op instead of panic for Campaigning while leader
2015-11-16 19:59:34 -08:00
Ben Darnell fbeb58d265 raft: no-op instead of panic for Campaigning while leader
We need to be able to force an election (on one node) after creating a
new group (cockroachdb/cockroach#1384), but it is difficult to ensure
that our call to Campaign does not race with an election that may be
started by raft itself. A redundant call to Campaign should be a no-op
instead of a panic. (But the panic in becomeCandidate remains, because
we don't want to update the term or change the committed index in this
case)
2015-11-16 21:44:14 -05:00
Jonathan Boulle 5fa875fb5d Merge pull request #3876 from jonboulle/master
scripts: clean up genproto
2015-11-16 16:43:11 -08:00
Jonathan Boulle dd0932a78d scripts: clean up genproto
Rather than copying in .proto files, use the same symlink
trick we do for doing the actual etcd build.

Also check for exact version of protoc early on.
2015-11-16 15:26:22 -08:00
Xiang Li 32460538ba Merge pull request #3862 from xiang90/watch_bench_doc
doc: add etcd3 watch benchmark doc
2015-11-16 12:14:19 -08:00
Yicheng Qin dfc7cc7a62 tools/etcd-tester: extend timeout for stresser
Extend the timeout from 1s to defaultRequestTimeout 5s.

The 1s may bring unwanted burden to the target member. If the member is
busy at recovering, it has limited bandwidth for client requests. A
short timeout at client side will retry quickly while keeping the
on-going connections. Thus, etcd will queue lots of requests and
connections and takes long time to clear them. This finally causes the
timeout of member health check.

This problem is a general one that how etcd handles amounts of requests
at the same time in a good way. We don't plan to address it at current
stage.
2015-11-16 11:47:08 -08:00
Xiang Li 6c0f14cefc Merge pull request #3870 from yichengq/fix-raft-log
raft: fix print format for term in one log line
2015-11-15 20:31:18 -08:00
Yicheng Qin 3a65442d7d raft: fix print format for term in one log line
`term` should be printed in decimal representation instead of
hexadecimal one.
2015-11-15 20:26:16 -08:00
Xiang Li fdd87cd899 Merge pull request #3868 from xiang90/fix_auth_guest
auth: use canonical path for pre-defined guest role
2015-11-15 19:17:16 -08:00
Xiang Li a1616afc5d auth: use canonical path for pre-defined guest role 2015-11-15 17:58:09 -08:00
Xiang Li 6bdc81d979 Merge pull request #3865 from gyuho/map_populate_for_unix
storage/backend: support MAP_POPULATE for unix
2015-11-15 16:53:32 -08:00
Gyu-Ho Lee 7638423f85 storage/backend: support MAP_POPULATE for unix
This adds build constraints in order to pass memory-map flags to bolt.Option.
If backend package passes syscall.MAP_POPULATE flag, the boltdb does read-ahead
which speeds up entire-database read, which then leads to faster storage
Restore. Benchmark result shows for 4GB, it opens and loads 6x faster in SSD,
and 12x faster in HDD. For 2GB, 1.6x faster with MAP_POPULATE in SSD.
2015-11-15 16:47:38 -08:00
Xiang Li 37d3d20211 doc: add etcd3 watch benchmark doc
The primary goal of this doc is to confirm the memory
consumption of watch is as expected. Each connection
consumes O(10kb) of memory. Each stream consumes O(10kb)
of memory. Each watching consumes < O(1kb) of memory.

Then when you have a large number of watching with small
number of connections and streams, the ave memory consumption
per watch will be O(1kb).
2015-11-15 16:38:09 -08:00
Xiang Li 185097ffaa Merge pull request #3860 from gyuho/typo_in_wal
wal: minor typo in wal pkg
2015-11-12 16:14:16 -08:00