37 Commits

Author SHA1 Message Date
Gyu-Ho Lee
3d75395875 *: remove never-unused vars, minor lint fix
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-06 14:59:12 -08:00
Xiang Li
53084ebead etcd: fix refresh feature
When using refresh, etcd store v2 watch is broken. Although with refresh
store should not trigger current watchers, it should still add events into
the watchhub to make a complete history. Current store fails to add the event
into the watchhub, which causes issues.
2016-05-25 13:33:31 -07:00
Gyu-Ho Lee
ef44f71da9 *: update LICENSE header 2016-05-12 20:51:48 -07:00
Anthony Romano
20461ab11a *: fix many typos 2016-01-31 21:42:39 -08:00
Xiang Li
d7a027e476 store: fix data race when modify event in watchHub.
The event got from watchHub should be considered as readonly.
To modify it, we first need to get a clone of it or there might
be a data race.
2015-12-09 10:11:51 -08:00
Brandon Philips
fb1951204c etcdserver: move atomics to make etcd work on arm64
Follow the simple rule in the atomic package:

"On both ARM and x86-32, it is the caller's responsibility to arrange
for 64-bit alignment of 64-bit words accessed atomically. The first word
in a global variable or in an allocated struct or slice can be relied
upon to be 64-bit aligned."

Tested on a system with /proc/cpuinfo reporting:

processor       : 0
model name      : ARMv7 Processor rev 1 (v7l)
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3
tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc0d
CPU revision    : 1
2015-08-08 18:11:41 -07:00
Michal Witkowski
7bca757d09 *: add metrics to store and proxy. 2015-07-07 16:01:51 +01:00
Xiang Li
999917010d store: fix watcher removal 2015-04-03 10:13:43 -07:00
Jonathan Boulle
f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Xiang Li
793cb095b0 store: fix race in watcher_hub
Get the lock before modifing the global objects in the hub.
2014-12-05 12:09:48 -08:00
Jonathan Boulle
7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Jonathan Boulle
26160b2154 store: use a larger buffer for eventChan
The event channel for watches can drop events too easily in the case of
streaming watches. This increases the buffer to a more useful level.
2014-10-07 01:57:05 -07:00
Jonathan Boulle
1c11f6a144 *: expose etcd-index in watch requests
This adds a StartIndex field to the Watcher interface, which represents
the Etcd-Index at which the Watcher is created.

Also refactors the HTTP tests to use a table for most handleWatch tests
2014-10-02 18:10:11 -07:00
Jonathan Boulle
5441c6aa54 etcdserver: correct X-Etcd-Index header
This adds an EtcdIndex field to store.Event and uses that as the header
instead of the node's modifiedIndex. To facilitate this in a non-racy
way, we set the EtcdIndex while holding the lock.
2014-09-22 18:56:12 -07:00
Jonathan Boulle
f7444ff300 store: convert Watch to interface 2014-09-09 11:17:53 -07:00
Cenk Alti
8bed1e1f15 fix(store/watch): fix the slow consumer bug 2014-02-14 16:52:40 -08:00
Xiang Li
c844fccf2a fix(watcher_hub) isHidden checks the length of the watchPath before getting subString of keyPath 2014-02-06 11:09:47 -05:00
Xiang Li
5851cb5b8d chrod(watcher_hub) add comment to isHidden function 2014-02-05 23:31:38 -05:00
Xiang Li
ba98de6ef0 fix(watch hidden key) Fix hidden keys preventing deeper recursive watches from receiving events
If a watcher has given the correct hidden directory, we should allow it to watch the non-hidden events under that hidden directory. This pull request achieves this by checking if the path after the watching prefix has a "/_" which indicates a hidden key.
2014-02-05 22:34:41 -05:00
tobz
823fdfab12 fix(store): make isHidden see if any portion of the path is hidden, not just the last element 2014-01-22 09:29:33 -05:00
tobz
7a948746a8 fix(store): move logic to handle whether or not to notify (re: hidden keys) entirely into watcher hub 2014-01-22 09:02:42 -05:00
tobz
139f59f7d1 fix(store): properly hide hidden keys from watchers, not just gets 2014-01-21 20:26:56 -05:00
Cenk Alti
8597904bc2 feat(stream watchers) fix locking issue 2014-01-10 16:04:23 +02:00
Xiang Li
22a25a18b3 feat(stream watchers) add stream watcher support 2014-01-09 15:28:33 +08:00
Xiang Li
fa3b4a7941 refactor(watcher) change newWatcher to Watch 2014-01-09 13:29:04 +08:00
Xiang Li
bbbf8fd574 fix(watcher_hub.go) decrease count when remove a watcher 2013-12-28 15:51:16 +08:00
Xiang Li
d66dc3c1c7 refactor(watcher_hub.go) refactor notifyWatchers() 2013-12-28 15:49:05 +08:00
Xiang Li
59ccefee0f fix(watchhub.go) add a lock to protect the hashmap 2013-12-28 14:55:50 +08:00
Xiang Li
5e499456f0 init cancel watcher 2013-12-26 22:06:15 +08:00
Xiang Li
c6e1af8321 merge master 2013-12-02 22:36:38 -05:00
Xiang Li
5097a2adee fix(event_history.go) should not scan prefix 2013-12-01 00:47:23 -05:00
Xiang Li
b7d07ea5c8 refactor event 2013-11-28 11:33:40 -05:00
Xiang Li
6156d5c790 refactor separate etcd index from raft index 2013-11-09 17:55:54 -08:00
Xiang Li
0372cdea23 refactor move sync command into etcd 2013-11-08 16:00:58 -08:00
Xiang Li
c307b6abca fix watcher_hub 2013-11-06 21:19:37 -08:00
Xiang Li
55058c64f5 feat wathch for expiring need to be pending 2013-11-05 23:30:48 -08:00
Xiang Li
a71838a59b refactor watcher.go 2013-10-07 22:17:58 -07:00