33 Commits

Author SHA1 Message Date
Xiang Li
2e92779777 mvcc: attach keys to leases after recover all state
The previous logic is wrong. When we have hisotry like Put(foo, bar, lease1),
and Put(foo, bar, lease2), we will end up with attaching foo to two leases 1 and
2. Similar things can happen for deattach by clearing the lease of a key.

Now we try to fix this by starting to attach leases at the end of the recovery.
We use a map to keep the last lease attachment state.
2016-08-19 11:49:05 -07:00
Xiang Li
ec576ee5ac mvcc: fix count 2016-08-16 12:13:33 -07:00
Gyu-Ho Lee
602198105d *: regenerate proto 2016-07-18 11:08:51 -07:00
Xiang Li
269de67bde mvcc: do not hash consistent index 2016-06-28 12:29:36 -07:00
Xiang Li
9614dc6e71 etcdserver: check index of the kv when restarting 2016-06-27 10:27:27 -07:00
Nikita Vetoshkin
dbc7c2cf4e backend: reuse timer in run().
Benchmarks:

```
import (
	"testing"
	"time"
)

func BenchmarkTimeAfter(b *testing.B) {
	b.ReportAllocs()
	for n := 0; n < b.N; n++ {
		select {
		case <- time.After(1 * time.Millisecond):
		}
	}
}

func BenchmarkTimerReset(b *testing.B) {
	b.ReportAllocs()
	t := time.NewTimer(1 * time.Millisecond)
	for n := 0; n < b.N; n++ {
		select {
		case <- t.C:
		}
		t.Reset(1 * time.Millisecond)
	}
}
```

Running reveals that each loop results in 3 allocs:

```
BenchmarkTimeAfter-4 	    2000	   1112134 ns/op	     192 B/op	       3 allocs/op
BenchmarkTimerReset-4	    2000	   1109774 ns/op	       0 B/op	       0 allocs/op
```
2016-06-23 18:49:41 +05:00
Xiang Li
def21f11a9 *: support count in range query 2016-06-21 16:20:55 -07:00
Xiang Li
6f28b43806 *: fix pending events metrics 2016-06-19 23:00:39 -07:00
Xiang Li
5a7b7f7595 main: add grpc-gateway support
Now etcd can serve HTTP json request at /v3alpha/
2016-06-14 17:09:06 -07:00
Gyu-Ho Lee
6bbd8b7efb mvcc: add keyIndex benchmark test
Useful later when trying to optimize our restore operations.
2016-06-09 14:13:18 -07:00
Gyu-Ho Lee
1610391449 *: following changes for proto update 2016-06-07 13:33:03 -07:00
Anthony Romano
f57b4eb46d mvcc: don't cancel watcher if stream is already closed
Close() already cancels all the watchers but doesn't bother to clear out
the bookkeeping maps so Cancel() may try to cancel twice.

Fixes #5533
2016-06-03 11:12:46 -07:00
Anthony Romano
9c767cbf98 Merge pull request #5464 from heyitsanthony/fix-victim-watchers
mvcc: tighten up watcher cancelation and revision handling
2016-05-30 20:09:39 -06:00
Gyu-Ho Lee
3266c809e4 mvcc: delete EXPIRE event type
Addressing https://github.com/coreos/etcd/pull/5484#discussion_r65005236.
etcd v3 doesn't expire keys. It's either PUT of DELETE.
2016-05-29 14:54:38 -07:00
Anthony Romano
cfb3f96c2b mvcc: tighten up watcher cancelation and revision handling
Makes w.cur into w.minrev, the minimum revision for the next update, and
retries cancelation if the watcher isn't found (because it's being processed
by moveVictims).

Fixes: #5459
2016-05-27 17:19:32 -07:00
Gyu-Ho Lee
bf8cf39daf mvcc: use capnslog 2016-05-20 22:31:22 -07:00
Anthony Romano
394ce5f3b8 mvcc: move blocked unsynced watchers to victim list 2016-05-20 15:56:02 -07:00
Anthony Romano
5984e46364 mvcc: move blocked sync watcher work to victim list
Instead of holding the store lock while doing a lot of work like when syncung
unsynced watchers, the work from a blocked synced notify can be reused and
dispatched without holding the store lock for long.
2016-05-20 15:56:02 -07:00
Anthony Romano
0b34b236d6 mvcc: benchmark for synced watchers 2016-05-19 23:31:27 -07:00
Gyu-Ho Lee
aa85cf037f mvcc: remove defer in watchable store 2016-05-19 13:51:51 -07:00
Xiang Li
6f2e7875aa etcdctl: add migrate command
Migrate command accepts a datadir and an optional user-provided
transformer function that transform v2 keys to v2 keys.

Migrate command then builds a v3 backend state based on the existing
v2 keys and the output of the transformer function.
2016-05-19 12:17:15 -07:00
Gyu-Ho Lee
77775e8e92 mvcc: preallocate bytes buffer for saveIndex 2016-05-18 10:01:57 -07:00
Nick Owens
e4e4c9dc2c mvcc: set bolt options to nil for non-linux systems 2016-05-17 12:46:44 -07:00
Gyu-Ho Lee
9d9f02c1ee mvcc: update LICENSE header 2016-05-12 20:50:33 -07:00
Anthony Romano
080272be17 mvcc: limit total watchers synced per sync
Fixes #4567
2016-05-11 11:16:43 -07:00
Xiang Li
0fb7cb8b00 *: add disk operation metrics for monitoring 2016-05-11 09:36:45 -07:00
Gyu-Ho Lee
a288188001 *: typo, remove string type assertions 2016-05-03 10:59:57 -07:00
Gyu-Ho Lee
015acabdbb *: rerun genproto -g 2016-05-02 23:02:31 -07:00
Gyu-Ho Lee
7a6d9ea01a mvcc: Hash to return Revision 2016-05-02 15:04:24 -07:00
Xiang Li
ad327e01d0 mvcc: add benchmark for watch put and improve it 2016-04-29 19:58:37 -07:00
Xiang Li
3ddcc21179 mvcc: fix watch deleteRange 2016-04-29 09:40:28 -07:00
Xiang Li
67645095e9 *: add debugging metrics 2016-04-26 09:52:56 -07:00
Anthony Romano
b7ac758969 *: rename storage package to mvcc 2016-04-25 15:25:51 -07:00