Commit Graph

337 Commits (336e4f2f28799d901bd76f58372dc274fd45d777)

Author SHA1 Message Date
Xiang Li df56f9d6f9 store: copy old value when refresh + cas 2016-06-15 15:32:58 -07:00
Xiang Li 6acb3d67fb Merge pull request #5448 from xiang90/fix_refrsh
etcd: fix refresh feature
2016-05-26 09:53:13 -07: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
mqliang ffd3cb78d4 store: use Rlock when GET 2016-05-24 17:13:29 +08:00
Gyu-Ho Lee ef44f71da9 *: update LICENSE header 2016-05-12 20:51:48 -07:00
Xiang Li 67645095e9 *: add debugging metrics 2016-04-26 09:52:56 -07:00
Gyu-Ho Lee 89f8e66682 *: fixes based on ineffassign 2016-04-13 10:41:58 -07:00
Gyu-Ho Lee fb85da92e8 *: fix based on gosimple and unused 2016-04-07 23:16:37 -07:00
Anthony Romano bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
Hongchao Deng dcaf5ef586 move store recorder to 'mock/mockstore' 2016-03-15 15:41:07 -07:00
Anthony Romano c5b51946eb *: exported godoc fixups 2016-02-21 20:36:44 -08:00
Caleb Champlin 82778ed478 Add refresh parameter to allow TTL refreshes without firing watch/wait responses 2016-02-08 10:37:37 -07:00
Anthony Romano 20461ab11a *: fix many typos 2016-01-31 21:42:39 -08:00
Gyu-Ho Lee 445ff6970b store: fix to 'go vet' errors
This check has been introduced to go tip [1]. Just fixes by calling
the Index method.

[1]: 0f89efa255
2016-01-30 17:53:58 -08:00
Anthony Romano 64596f0c49 etcdserver/test: synchronously wait on TestApplySnapshotAndCommittedEntries
Replaces the RecorderBuffered with a RecorderStream so Wait will block
waiting for updates to the etcdserver store.

Fixes #4296
2016-01-26 21:03:03 -08:00
Xiang Li 547250321b store: handle watch dir removal correctly 2016-01-11 22:42:56 -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
Gyu-Ho Lee 04ac8969a1 Merge pull request #3986 from mqliang/defer
refactor store/store.go
2015-12-29 14:42:11 -07:00
Gyu-Ho Lee b072f0b048 store: fix expiration var shadowing, change test function names
Found at https://travis-ci.org/coreos/etcd/jobs/99087279#L298.
And changes test function names to make them clear.
2015-12-28 08:50:34 -08:00
Gyu-Ho Lee 64e182c69e store: clean up event.go, node.go and add tests
Updates IsCreated logic on event.go. Cleans up node.go
and adds tests to it.
2015-12-25 13:25:12 -08:00
mqliang 1c559bdb33 store: refactor
use defer statement to update `Stats` and report R/W Sucess/Failure, so
that the logic of Store's CURD operation and `Stats` update logic can be
separated.
2015-12-15 16:50:02 +08:00
Gyu-Ho Lee a45b902d12 store: fixes shadowed variables with go tool vet.
Fixes for https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:38:26 -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
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
Gyu-Ho Lee c2dcf7431e etcdserver, store: fix grammars in comments (a->an existing)
I found some grammatical errors in comments.

This pull request was submitted https://github.com/coreos/etcd/pull/3513.
I am resubmitting following the correct guidlines.
2015-09-14 13:41:13 -07:00
Xiang Li a7b9bff939 store: add 0 as padding for better lexicographic sorting. 2015-08-13 13:42:37 -07: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
Brandon Philips 2a675c08c2 store: always check the error
Ensure that we propogate any errors out of the node.Remove operation
back to the user. There is no reason to assume here.
2015-04-16 17:22:57 -07:00
Xiang Li 999917010d store: fix watcher removal 2015-04-03 10:13:43 -07:00
招牌疯子 afed8cf044 store: fixed clone error for store stats. 2015-03-20 12:31:47 +08:00
Xiang Li d459ae0df3 store: remove unused ACL field 2015-02-28 11:46:21 -08:00
Xiang Li a4dab7ad75 *: do not block etcdserver when encoding store into json
Encoding store into json snapshot has quite high CPU cost. And it
will block for a while. This commit makes the encoding process non-
blocking by running it in another go-routine.
2015-02-28 11:41:58 -08:00
Barak Michener 92dca0af0f *: remove shadowing of variables from etcd and add travis test
We've been bitten by this enough times that I wrote a tool so that
it never happens again.
2015-02-17 16:31:42 -05:00
Xiang Li 9776e6d082 store: fix modifiedindex in node clone 2015-02-05 22:26:52 -08:00
Yicheng Qin 3ac0298bd0 store: set readonly to pre-defined namespaces 2015-02-04 16:47:08 -08:00
Yicheng Qin f13c7872d5 etcdserver: register pre-defined namespaces in store 2015-02-04 16:33:40 -08: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
Yicheng Qin c104ca89c2 store: optimize ttlKeyHeap GC
It helps to recycle nodes in heap array, whose value can be unlimited
long.
2015-01-20 12:01:57 -08:00
Xiang Li 773f112a5d store: return utc time to user 2014-12-11 16:24:33 -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
Yicheng Qin a910d8ba9f store: copy Nodes correctly in NodeExtern.Clone 2014-10-29 16:54:09 -07:00
Jonathan Boulle 84be7c1e9e etcdserver/store: clone Events before modifying 2014-10-29 11:54:35 -07:00
Jonathan Boulle 7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Jonathan Boulle 1456ae4453 store: restore minExpireTime check and advance FakeClock appropriately 2014-10-17 10:05:29 -07:00
Jonathan Boulle e0801360d3 godep: update clockwork dependency 2014-10-17 10:05:29 -07:00
Jonathan Boulle 3134658ded store: switch to fake clock 2014-10-17 10:05:29 -07:00
Jonathan Boulle 5c4edf65f9 store: remove another unused function 2014-10-17 00:07:45 -07:00
Jonathan Boulle 1fa763b47b store: remove unused function 2014-10-17 00:07:23 -07:00