ソースを参照

*: rename storage package to mvcc

Anthony Romano 9 年 前
コミット
b7ac758969
93 ファイル変更778 行追加811 行削除
  1. 1 1
      Documentation/api_v3.md
  2. 4 4
      Documentation/dev-guide/api_reference_v3.md
  3. 2 2
      Documentation/dev-guide/interacting_v3.md
  4. 2 2
      Documentation/op-guide/maintenance.md
  5. 1 1
      Documentation/rfc/v3api.md
  6. 1 1
      alarm/alarms.go
  7. 14 15
      auth/authpb/auth.pb.go
  8. 1 1
      auth/store.go
  9. 5 5
      clientv3/concurrency/election.go
  10. 2 2
      clientv3/concurrency/key.go
  11. 11 11
      clientv3/integration/kv_test.go
  12. 3 3
      clientv3/integration/mirror_test.go
  13. 3 3
      clientv3/integration/watch_test.go
  14. 4 4
      clientv3/watch.go
  15. 3 3
      clientv3/watch_test.go
  16. 2 2
      compactor/compactor.go
  17. 2 2
      contrib/recipes/barrier.go
  18. 1 1
      contrib/recipes/client.go
  19. 4 4
      contrib/recipes/double_barrier.go
  20. 2 2
      contrib/recipes/priority_queue.go
  21. 2 2
      contrib/recipes/queue.go
  22. 2 2
      contrib/recipes/rwmutex.go
  23. 4 4
      contrib/recipes/watch.go
  24. 2 2
      e2e/ctl_v3_alarm_test.go
  25. 1 1
      etcdctl/READMEv3.md
  26. 3 3
      etcdctl/ctlv3/command/make_mirror_command.go
  27. 1 1
      etcdctl/ctlv3/command/printer.go
  28. 3 3
      etcdctl/ctlv3/command/snapshot_command.go
  29. 1 1
      etcdctl/ctlv3/command/util.go
  30. 1 1
      etcdserver/api/v3rpc/maintenance.go
  31. 3 3
      etcdserver/api/v3rpc/rpctypes/error.go
  32. 3 3
      etcdserver/api/v3rpc/util.go
  33. 20 20
      etcdserver/api/v3rpc/watch.go
  34. 8 8
      etcdserver/apply.go
  35. 1 1
      etcdserver/consistent_index.go
  36. 40 45
      etcdserver/etcdserverpb/etcdserver.pb.go
  37. 42 46
      etcdserver/etcdserverpb/raft_internal.pb.go
  38. 190 205
      etcdserver/etcdserverpb/rpc.pb.go
  39. 3 3
      etcdserver/etcdserverpb/rpc.proto
  40. 1 1
      etcdserver/membership/cluster.go
  41. 1 1
      etcdserver/membership/store.go
  42. 1 1
      etcdserver/quota.go
  43. 5 5
      etcdserver/server.go
  44. 5 5
      etcdserver/server_test.go
  45. 1 1
      etcdserver/snapshot_merge.go
  46. 2 2
      etcdserver/v3_server.go
  47. 2 2
      integration/v3_lease_test.go
  48. 53 53
      integration/v3_watch_test.go
  49. 8 9
      lease/leasepb/lease.pb.go
  50. 2 2
      lease/lessor.go
  51. 1 1
      lease/lessor_test.go
  52. 0 0
      mvcc/backend/backend.go
  53. 0 0
      mvcc/backend/backend_bench_test.go
  54. 0 0
      mvcc/backend/backend_test.go
  55. 8 8
      mvcc/backend/batch_tx.go
  56. 0 0
      mvcc/backend/batch_tx_test.go
  57. 0 0
      mvcc/backend/boltoption_darwin.go
  58. 0 0
      mvcc/backend/boltoption_freebsd.go
  59. 0 0
      mvcc/backend/boltoption_solaris.go
  60. 0 0
      mvcc/backend/boltoption_unix.go
  61. 0 0
      mvcc/backend/boltoption_windows.go
  62. 1 1
      mvcc/backend/doc.go
  63. 2 2
      mvcc/doc.go
  64. 1 1
      mvcc/index.go
  65. 1 1
      mvcc/index_test.go
  66. 1 1
      mvcc/key_index.go
  67. 1 1
      mvcc/key_index_test.go
  68. 5 5
      mvcc/kv.go
  69. 27 27
      mvcc/kv_test.go
  70. 31 31
      mvcc/kvstore.go
  71. 2 2
      mvcc/kvstore_bench_test.go
  72. 1 1
      mvcc/kvstore_compaction.go
  73. 2 2
      mvcc/kvstore_compaction_test.go
  74. 14 14
      mvcc/kvstore_test.go
  75. 16 16
      mvcc/metrics.go
  76. 24 26
      mvcc/mvccpb/kv.pb.go
  77. 1 1
      mvcc/mvccpb/kv.proto
  78. 1 1
      mvcc/revision.go
  79. 1 1
      mvcc/revision_test.go
  80. 22 22
      mvcc/watchable_store.go
  81. 2 2
      mvcc/watchable_store_bench_test.go
  82. 19 19
      mvcc/watchable_store_test.go
  83. 4 4
      mvcc/watcher.go
  84. 2 2
      mvcc/watcher_bench_test.go
  85. 6 6
      mvcc/watcher_group.go
  86. 2 2
      mvcc/watcher_test.go
  87. 52 56
      raft/raftpb/raft.pb.go
  88. 2 2
      scripts/genproto.sh
  89. 6 7
      snap/snappb/snap.pb.go
  90. 2 2
      test
  91. 11 11
      tools/benchmark/cmd/mvcc-put.go
  92. 18 18
      tools/benchmark/cmd/mvcc.go
  93. 10 10
      wal/walpb/record.pb.go

+ 1 - 1
Documentation/api_v3.md

@@ -141,6 +141,6 @@ etcd ensures linearizability for all other operations by default. Linearizabilit
 [strict_consistency]: https://en.wikipedia.org/wiki/Consistency_model#Strict_consistency
 [strict_consistency]: https://en.wikipedia.org/wiki/Consistency_model#Strict_consistency
 [serializable_isolation]: https://en.wikipedia.org/wiki/Isolation_(database_systems)#Serializable
 [serializable_isolation]: https://en.wikipedia.org/wiki/Isolation_(database_systems)#Serializable
 [Linearizability]: #Linearizability
 [Linearizability]: #Linearizability
-[kv-proto]: https://github.com/coreos/etcd/blob/master/storage/storagepb/kv.proto
+[kv-proto]: https://github.com/coreos/etcd/blob/master/mvcc/mvccpb/kv.proto
 [kv-service]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
 [kv-service]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
 [response_header]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
 [response_header]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto

+ 4 - 4
Documentation/dev-guide/api_reference_v3.md

@@ -567,7 +567,7 @@ Empty field.
 | Field | Description | Type |
 | Field | Description | Type |
 | ----- | ----------- | ---- |
 | ----- | ----------- | ---- |
 | header |  | ResponseHeader |
 | header |  | ResponseHeader |
-| kvs | kvs is the list of key-value pairs matched by the range request. | (slice of) storagepb.KeyValue |
+| kvs | kvs is the list of key-value pairs matched by the range request. | (slice of) mvccpb.KeyValue |
 | more | more indicates if there are more keys to return in the requested range. | bool |
 | more | more indicates if there are more keys to return in the requested range. | bool |
 
 
 
 
@@ -700,11 +700,11 @@ From google paxosdb paper: Our implementation hinges around a powerful primitive
 | created | created is set to true if the response is for a create watch request. The client should record the watch_id and expect to receive events for the created watcher from the same stream. All events sent to the created watcher will attach with the same watch_id. | bool |
 | created | created is set to true if the response is for a create watch request. The client should record the watch_id and expect to receive events for the created watcher from the same stream. All events sent to the created watcher will attach with the same watch_id. | bool |
 | canceled | canceled is set to true if the response is for a cancel watch request. No further events will be sent to the canceled watcher. | bool |
 | canceled | canceled is set to true if the response is for a cancel watch request. No further events will be sent to the canceled watcher. | bool |
 | compact_revision | compact_revision is set to the minimum index if a watcher tries to watch at a compacted index.  This happens when creating a watcher at a compacted revision or the watcher cannot catch up with the progress of the key-value store.  The client should treat the watcher as canceled and should not try to create any watcher with the same start_revision again. | int64 |
 | compact_revision | compact_revision is set to the minimum index if a watcher tries to watch at a compacted index.  This happens when creating a watcher at a compacted revision or the watcher cannot catch up with the progress of the key-value store.  The client should treat the watcher as canceled and should not try to create any watcher with the same start_revision again. | int64 |
-| events |  | (slice of) storagepb.Event |
+| events |  | (slice of) mvccpb.Event |
 
 
 
 
 
 
-##### message `Event` (storage/storagepb/kv.proto)
+##### message `Event` (mvcc/mvccpb/kv.proto)
 
 
 | Field | Description | Type |
 | Field | Description | Type |
 | ----- | ----------- | ---- |
 | ----- | ----------- | ---- |
@@ -713,7 +713,7 @@ From google paxosdb paper: Our implementation hinges around a powerful primitive
 
 
 
 
 
 
-##### message `KeyValue` (storage/storagepb/kv.proto)
+##### message `KeyValue` (mvcc/mvccpb/kv.proto)
 
 
 | Field | Description | Type |
 | Field | Description | Type |
 | ----- | ----------- | ---- |
 | ----- | ----------- | ---- |

+ 2 - 2
Documentation/dev-guide/interacting_v3.md

@@ -179,7 +179,7 @@ compacted revision 5
 
 
 # any revisions before the compacted one are not accessible
 # any revisions before the compacted one are not accessible
 $ etcdctl get --rev=4 foo
 $ etcdctl get --rev=4 foo
-Error:  rpc error: code = 11 desc = etcdserver: storage: required revision has been compacted
+Error:  rpc error: code = 11 desc = etcdserver: mvcc: required revision has been compacted
 ```
 ```
 
 
 ## Grant leases
 ## Grant leases
@@ -240,4 +240,4 @@ lease 32695410dcc0ca0 keepalived with TTL(100)
 lease 32695410dcc0ca0 keepalived with TTL(100)
 lease 32695410dcc0ca0 keepalived with TTL(100)
 lease 32695410dcc0ca0 keepalived with TTL(100)
 lease 32695410dcc0ca0 keepalived with TTL(100)
 ...
 ...
-```
+```

+ 2 - 2
Documentation/op-guide/maintenance.md

@@ -31,7 +31,7 @@ Revisions prior to the compaction revision become inaccessible:
 
 
 ```sh
 ```sh
 $ etcdctl get --rev=2 somekey
 $ etcdctl get --rev=2 somekey
-Error:  rpc error: code = 11 desc = etcdserver: storage: required revision has been compacted
+Error:  rpc error: code = 11 desc = etcdserver: mvcc: required revision has been compacted
 ```
 ```
 
 
 ## Defragmentation
 ## Defragmentation
@@ -64,7 +64,7 @@ The space quota can be triggered with a loop:
 # fill keyspace
 # fill keyspace
 $ while [ 1 ]; do dd if=/dev/urandom bs=1024 count=1024  | etcdctl put key  || break; done
 $ while [ 1 ]; do dd if=/dev/urandom bs=1024 count=1024  | etcdctl put key  || break; done
 ...
 ...
-Error:  rpc error: code = 8 desc = etcdserver: storage: database space exceeded
+Error:  rpc error: code = 8 desc = etcdserver: mvcc: database space exceeded
 # confirm quota space is exceeded
 # confirm quota space is exceeded
 $ etcdctl endpoint status
 $ etcdctl endpoint status
 +----------------+------------------+-----------+---------+-----------+-----------+------------+
 +----------------+------------------+-----------+---------+-----------+-----------+------------+

+ 1 - 1
Documentation/rfc/v3api.md

@@ -208,4 +208,4 @@ WatchResponse {
 ```
 ```
 
 
 [api-protobuf]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
 [api-protobuf]: https://github.com/coreos/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto
-[kv-protobuf]: https://github.com/coreos/etcd/blob/master/storage/storagepb/kv.proto
+[kv-protobuf]: https://github.com/coreos/etcd/blob/master/mvcc/mvccpb/kv.proto

+ 1 - 1
alarm/alarms.go

@@ -19,8 +19,8 @@ import (
 	"sync"
 	"sync"
 
 
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/pkg/types"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/pkg/capnslog"
 	"github.com/coreos/pkg/capnslog"
 )
 )
 
 

+ 14 - 15
auth/authpb/auth.pb.go

@@ -756,21 +756,20 @@ var (
 )
 )
 
 
 var fileDescriptorAuth = []byte{
 var fileDescriptorAuth = []byte{
-	// 254 bytes of a gzipped FileDescriptorProto
+	// 236 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x2c, 0x2d, 0xc9,
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x2c, 0x2d, 0xc9,
 	0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
 	0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
-	0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0xc9, 0x87, 0x8b, 0x25, 0xb4, 0x38, 0xb5,
-	0x48, 0x48, 0x88, 0x8b, 0x25, 0x2f, 0x31, 0x37, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x08,
-	0xcc, 0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	0x1e, 0xc9, 0x31, 0x5e, 0x00, 0xe2, 0x07, 0x40, 0x9c, 0xc4, 0x06, 0x0e, 0x06, 0x63, 0x40, 0x00,
+	0x00, 0x00, 0xff, 0xff, 0x8d, 0x09, 0x06, 0x6e, 0x32, 0x01, 0x00, 0x00,
 }
 }

+ 1 - 1
auth/store.go

@@ -22,7 +22,7 @@ import (
 
 
 	"github.com/coreos/etcd/auth/authpb"
 	"github.com/coreos/etcd/auth/authpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/pkg/capnslog"
 	"github.com/coreos/pkg/capnslog"
 	"golang.org/x/crypto/bcrypt"
 	"golang.org/x/crypto/bcrypt"
 )
 )

+ 5 - 5
clientv3/concurrency/election.go

@@ -18,7 +18,7 @@ import (
 	"errors"
 	"errors"
 
 
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -128,7 +128,7 @@ func (e *Election) observe(ctx context.Context, ch chan<- v3.GetResponse) {
 			return
 			return
 		}
 		}
 
 
-		var kv *storagepb.KeyValue
+		var kv *mvccpb.KeyValue
 
 
 		cctx, cancel := context.WithCancel(ctx)
 		cctx, cancel := context.WithCancel(ctx)
 		if len(resp.Kvs) == 0 {
 		if len(resp.Kvs) == 0 {
@@ -144,7 +144,7 @@ func (e *Election) observe(ctx context.Context, ch chan<- v3.GetResponse) {
 				}
 				}
 				// only accept PUTs; a DELETE will make observe() spin
 				// only accept PUTs; a DELETE will make observe() spin
 				for _, ev := range wr.Events {
 				for _, ev := range wr.Events {
-					if ev.Type == storagepb.PUT {
+					if ev.Type == mvccpb.PUT {
 						kv = ev.Kv
 						kv = ev.Kv
 						break
 						break
 					}
 					}
@@ -162,12 +162,12 @@ func (e *Election) observe(ctx context.Context, ch chan<- v3.GetResponse) {
 				return
 				return
 			}
 			}
 			for _, ev := range wr.Events {
 			for _, ev := range wr.Events {
-				if ev.Type == storagepb.DELETE {
+				if ev.Type == mvccpb.DELETE {
 					keyDeleted = true
 					keyDeleted = true
 					break
 					break
 				}
 				}
 				resp.Header = &wr.Header
 				resp.Header = &wr.Header
-				resp.Kvs = []*storagepb.KeyValue{ev.Kv}
+				resp.Kvs = []*mvccpb.KeyValue{ev.Kv}
 				select {
 				select {
 				case ch <- *resp:
 				case ch <- *resp:
 				case <-cctx.Done():
 				case <-cctx.Done():

+ 2 - 2
clientv3/concurrency/key.go

@@ -20,7 +20,7 @@ import (
 	"time"
 	"time"
 
 
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -51,7 +51,7 @@ func waitDelete(ctx context.Context, client *v3.Client, key string, rev int64) e
 	wch := client.Watch(cctx, key, v3.WithRev(rev))
 	wch := client.Watch(cctx, key, v3.WithRev(rev))
 	for wr := range wch {
 	for wr := range wch {
 		for _, ev := range wr.Events {
 		for _, ev := range wr.Events {
-			if ev.Type == storagepb.DELETE {
+			if ev.Type == mvccpb.DELETE {
 				return nil
 				return nil
 			}
 			}
 		}
 		}

+ 11 - 11
clientv3/integration/kv_test.go

@@ -23,8 +23,8 @@ import (
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/integration"
 	"github.com/coreos/etcd/integration"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	"github.com/coreos/etcd/storage/storagepb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -99,7 +99,7 @@ func TestKVRange(t *testing.T) {
 		rev        int64
 		rev        int64
 		opts       []clientv3.OpOption
 		opts       []clientv3.OpOption
 
 
-		wantSet []*storagepb.KeyValue
+		wantSet []*mvccpb.KeyValue
 	}{
 	}{
 		// range first two
 		// range first two
 		{
 		{
@@ -107,7 +107,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			nil,
 			nil,
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("b"), Value: nil, CreateRevision: 3, ModRevision: 3, Version: 1},
 				{Key: []byte("b"), Value: nil, CreateRevision: 3, ModRevision: 3, Version: 1},
 			},
 			},
@@ -118,7 +118,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			[]clientv3.OpOption{clientv3.WithSerializable()},
 			[]clientv3.OpOption{clientv3.WithSerializable()},
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("b"), Value: nil, CreateRevision: 3, ModRevision: 3, Version: 1},
 				{Key: []byte("b"), Value: nil, CreateRevision: 3, ModRevision: 3, Version: 1},
 			},
 			},
@@ -129,7 +129,7 @@ func TestKVRange(t *testing.T) {
 			2,
 			2,
 			nil,
 			nil,
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 			},
 			},
 		},
 		},
@@ -139,7 +139,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			[]clientv3.OpOption{clientv3.WithSort(clientv3.SortByKey, clientv3.SortAscend)},
 			[]clientv3.OpOption{clientv3.WithSort(clientv3.SortByKey, clientv3.SortAscend)},
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("a"), Value: nil, CreateRevision: 2, ModRevision: 2, Version: 1},
 				{Key: []byte("b"), Value: nil, CreateRevision: 3, ModRevision: 3, Version: 1},
 				{Key: []byte("b"), Value: nil, CreateRevision: 3, ModRevision: 3, Version: 1},
 				{Key: []byte("c"), Value: nil, CreateRevision: 4, ModRevision: 6, Version: 3},
 				{Key: []byte("c"), Value: nil, CreateRevision: 4, ModRevision: 6, Version: 3},
@@ -154,7 +154,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			[]clientv3.OpOption{clientv3.WithSort(clientv3.SortByCreateRevision, clientv3.SortDescend)},
 			[]clientv3.OpOption{clientv3.WithSort(clientv3.SortByCreateRevision, clientv3.SortDescend)},
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
 				{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
@@ -169,7 +169,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			[]clientv3.OpOption{clientv3.WithSort(clientv3.SortByModRevision, clientv3.SortDescend)},
 			[]clientv3.OpOption{clientv3.WithSort(clientv3.SortByModRevision, clientv3.SortDescend)},
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
 				{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
@@ -184,7 +184,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			[]clientv3.OpOption{clientv3.WithPrefix()},
 			[]clientv3.OpOption{clientv3.WithPrefix()},
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 			},
 			},
@@ -195,7 +195,7 @@ func TestKVRange(t *testing.T) {
 			0,
 			0,
 			[]clientv3.OpOption{clientv3.WithFromKey()},
 			[]clientv3.OpOption{clientv3.WithFromKey()},
 
 
-			[]*storagepb.KeyValue{
+			[]*mvccpb.KeyValue{
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
 				{Key: []byte("foo"), Value: nil, CreateRevision: 7, ModRevision: 7, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("foo/abc"), Value: nil, CreateRevision: 8, ModRevision: 8, Version: 1},
 				{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
 				{Key: []byte("fop"), Value: nil, CreateRevision: 9, ModRevision: 9, Version: 1},
@@ -392,7 +392,7 @@ func TestKVGetRetry(t *testing.T) {
 		if gerr != nil {
 		if gerr != nil {
 			t.Fatal(gerr)
 			t.Fatal(gerr)
 		}
 		}
-		wkvs := []*storagepb.KeyValue{
+		wkvs := []*mvccpb.KeyValue{
 			{
 			{
 				Key:            []byte("foo"),
 				Key:            []byte("foo"),
 				Value:          []byte("bar"),
 				Value:          []byte("bar"),

+ 3 - 3
clientv3/integration/mirror_test.go

@@ -21,8 +21,8 @@ import (
 
 
 	"github.com/coreos/etcd/clientv3/mirror"
 	"github.com/coreos/etcd/clientv3/mirror"
 	"github.com/coreos/etcd/integration"
 	"github.com/coreos/etcd/integration"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	"github.com/coreos/etcd/storage/storagepb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -40,7 +40,7 @@ func TestMirrorSync(t *testing.T) {
 
 
 	syncer := mirror.NewSyncer(c, "", 0)
 	syncer := mirror.NewSyncer(c, "", 0)
 	gch, ech := syncer.SyncBase(context.TODO())
 	gch, ech := syncer.SyncBase(context.TODO())
-	wkvs := []*storagepb.KeyValue{{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}}
+	wkvs := []*mvccpb.KeyValue{{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}}
 
 
 	for g := range gch {
 	for g := range gch {
 		if !reflect.DeepEqual(g.Kvs, wkvs) {
 		if !reflect.DeepEqual(g.Kvs, wkvs) {
@@ -61,7 +61,7 @@ func TestMirrorSync(t *testing.T) {
 
 
 	select {
 	select {
 	case r := <-wch:
 	case r := <-wch:
-		wkv := &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2}
+		wkv := &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2}
 		if !reflect.DeepEqual(r.Events[0].Kv, wkv) {
 		if !reflect.DeepEqual(r.Events[0].Kv, wkv) {
 			t.Fatalf("kv = %v, want %v", r.Events[0].Kv, wkv)
 			t.Fatalf("kv = %v, want %v", r.Events[0].Kv, wkv)
 		}
 		}

+ 3 - 3
clientv3/integration/watch_test.go

@@ -25,8 +25,8 @@ import (
 	"github.com/coreos/etcd/etcdserver/api/v3rpc"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/integration"
 	"github.com/coreos/etcd/integration"
+	mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	storagepb "github.com/coreos/etcd/storage/storagepb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -419,7 +419,7 @@ func testWatchWithProgressNotify(t *testing.T, watchOnPut bool) {
 		}
 		}
 		if watchOnPut { // wait for put if watch on the put key
 		if watchOnPut { // wait for put if watch on the put key
 			ev := []*clientv3.Event{{Type: clientv3.EventTypePut,
 			ev := []*clientv3.Event{{Type: clientv3.EventTypePut,
-				Kv: &storagepb.KeyValue{Key: []byte("foox"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}}}
+				Kv: &mvccpb.KeyValue{Key: []byte("foox"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}}}
 			if !reflect.DeepEqual(ev, resp.Events) {
 			if !reflect.DeepEqual(ev, resp.Events) {
 				t.Fatalf("expected %+v, got %+v", ev, resp.Events)
 				t.Fatalf("expected %+v, got %+v", ev, resp.Events)
 			}
 			}
@@ -457,7 +457,7 @@ func TestWatchEventType(t *testing.T) {
 	}
 	}
 
 
 	tests := []struct {
 	tests := []struct {
-		et       storagepb.Event_EventType
+		et       mvccpb.Event_EventType
 		isCreate bool
 		isCreate bool
 		isModify bool
 		isModify bool
 	}{{
 	}{{

+ 4 - 4
clientv3/watch.go

@@ -20,17 +20,17 @@ import (
 
 
 	v3rpc "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	v3rpc "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
-	storagepb "github.com/coreos/etcd/storage/storagepb"
+	mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
 )
 )
 
 
 const (
 const (
-	EventTypeDelete = storagepb.DELETE
-	EventTypePut    = storagepb.PUT
+	EventTypeDelete = mvccpb.DELETE
+	EventTypePut    = mvccpb.PUT
 )
 )
 
 
-type Event storagepb.Event
+type Event mvccpb.Event
 
 
 type WatchChan <-chan WatchResponse
 type WatchChan <-chan WatchResponse
 
 

+ 3 - 3
clientv3/watch_test.go

@@ -17,7 +17,7 @@ package clientv3
 import (
 import (
 	"testing"
 	"testing"
 
 
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 )
 )
 
 
 func TestEvent(t *testing.T) {
 func TestEvent(t *testing.T) {
@@ -28,7 +28,7 @@ func TestEvent(t *testing.T) {
 	}{{
 	}{{
 		ev: &Event{
 		ev: &Event{
 			Type: EventTypePut,
 			Type: EventTypePut,
-			Kv: &storagepb.KeyValue{
+			Kv: &mvccpb.KeyValue{
 				CreateRevision: 3,
 				CreateRevision: 3,
 				ModRevision:    3,
 				ModRevision:    3,
 			},
 			},
@@ -37,7 +37,7 @@ func TestEvent(t *testing.T) {
 	}, {
 	}, {
 		ev: &Event{
 		ev: &Event{
 			Type: EventTypePut,
 			Type: EventTypePut,
-			Kv: &storagepb.KeyValue{
+			Kv: &mvccpb.KeyValue{
 				CreateRevision: 3,
 				CreateRevision: 3,
 				ModRevision:    4,
 				ModRevision:    4,
 			},
 			},

+ 2 - 2
compactor/compactor.go

@@ -19,7 +19,7 @@ import (
 	"time"
 	"time"
 
 
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
-	"github.com/coreos/etcd/storage"
+	"github.com/coreos/etcd/mvcc"
 	"github.com/coreos/pkg/capnslog"
 	"github.com/coreos/pkg/capnslog"
 	"github.com/jonboulle/clockwork"
 	"github.com/jonboulle/clockwork"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
@@ -96,7 +96,7 @@ func (t *Periodic) Run() {
 
 
 			plog.Noticef("Starting auto-compaction at revision %d", rev)
 			plog.Noticef("Starting auto-compaction at revision %d", rev)
 			_, err := t.c.Compact(t.ctx, &pb.CompactionRequest{Revision: rev})
 			_, err := t.c.Compact(t.ctx, &pb.CompactionRequest{Revision: rev})
-			if err == nil || err == storage.ErrCompacted {
+			if err == nil || err == mvcc.ErrCompacted {
 				t.revs = make([]int64, 0)
 				t.revs = make([]int64, 0)
 				last = clock.Now()
 				last = clock.Now()
 				plog.Noticef("Finished auto-compaction at revision %d", rev)
 				plog.Noticef("Finished auto-compaction at revision %d", rev)

+ 2 - 2
contrib/recipes/barrier.go

@@ -16,7 +16,7 @@ package recipe
 
 
 import (
 import (
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -60,6 +60,6 @@ func (b *Barrier) Wait() error {
 		b.client,
 		b.client,
 		b.key,
 		b.key,
 		resp.Header.Revision,
 		resp.Header.Revision,
-		[]storagepb.Event_EventType{storagepb.PUT, storagepb.DELETE})
+		[]mvccpb.Event_EventType{mvccpb.PUT, mvccpb.DELETE})
 	return err
 	return err
 }
 }

+ 1 - 1
contrib/recipes/client.go

@@ -18,7 +18,7 @@ import (
 	"errors"
 	"errors"
 
 
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	spb "github.com/coreos/etcd/storage/storagepb"
+	spb "github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 

+ 4 - 4
contrib/recipes/double_barrier.go

@@ -16,7 +16,7 @@ package recipe
 
 
 import (
 import (
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -67,7 +67,7 @@ func (b *DoubleBarrier) Enter() error {
 		b.client,
 		b.client,
 		b.key+"/ready",
 		b.key+"/ready",
 		ek.Revision(),
 		ek.Revision(),
-		[]storagepb.Event_EventType{storagepb.PUT})
+		[]mvccpb.Event_EventType{mvccpb.PUT})
 	return err
 	return err
 }
 }
 
 
@@ -109,7 +109,7 @@ func (b *DoubleBarrier) Leave() error {
 			b.client,
 			b.client,
 			string(highest.Key),
 			string(highest.Key),
 			highest.ModRevision,
 			highest.ModRevision,
-			[]storagepb.Event_EventType{storagepb.DELETE})
+			[]mvccpb.Event_EventType{mvccpb.DELETE})
 		if err != nil {
 		if err != nil {
 			return err
 			return err
 		}
 		}
@@ -126,7 +126,7 @@ func (b *DoubleBarrier) Leave() error {
 		b.client,
 		b.client,
 		key,
 		key,
 		lowest.ModRevision,
 		lowest.ModRevision,
-		[]storagepb.Event_EventType{storagepb.DELETE})
+		[]mvccpb.Event_EventType{mvccpb.DELETE})
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}

+ 2 - 2
contrib/recipes/priority_queue.go

@@ -18,7 +18,7 @@ import (
 	"fmt"
 	"fmt"
 
 
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -65,7 +65,7 @@ func (q *PriorityQueue) Dequeue() (string, error) {
 		q.client,
 		q.client,
 		q.key,
 		q.key,
 		resp.Header.Revision,
 		resp.Header.Revision,
-		[]storagepb.Event_EventType{storagepb.PUT})
+		[]mvccpb.Event_EventType{mvccpb.PUT})
 	if err != nil {
 	if err != nil {
 		return "", err
 		return "", err
 	}
 	}

+ 2 - 2
contrib/recipes/queue.go

@@ -16,7 +16,7 @@ package recipe
 
 
 import (
 import (
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -61,7 +61,7 @@ func (q *Queue) Dequeue() (string, error) {
 		q.client,
 		q.client,
 		q.keyPrefix,
 		q.keyPrefix,
 		resp.Header.Revision,
 		resp.Header.Revision,
-		[]storagepb.Event_EventType{storagepb.PUT})
+		[]mvccpb.Event_EventType{mvccpb.PUT})
 	if err != nil {
 	if err != nil {
 		return "", err
 		return "", err
 	}
 	}

+ 2 - 2
contrib/recipes/rwmutex.go

@@ -16,7 +16,7 @@ package recipe
 
 
 import (
 import (
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -91,7 +91,7 @@ func (rwm *RWMutex) waitOnLowest() error {
 		rwm.client,
 		rwm.client,
 		string(lastKey.Kvs[0].Key),
 		string(lastKey.Kvs[0].Key),
 		rwm.myKey.Revision(),
 		rwm.myKey.Revision(),
-		[]storagepb.Event_EventType{storagepb.DELETE})
+		[]mvccpb.Event_EventType{mvccpb.DELETE})
 	return err
 	return err
 }
 }
 
 

+ 4 - 4
contrib/recipes/watch.go

@@ -16,12 +16,12 @@ package recipe
 
 
 import (
 import (
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/clientv3"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
 // WaitEvents waits on a key until it observes the given events and returns the final one.
 // WaitEvents waits on a key until it observes the given events and returns the final one.
-func WaitEvents(c *clientv3.Client, key string, rev int64, evs []storagepb.Event_EventType) (*clientv3.Event, error) {
+func WaitEvents(c *clientv3.Client, key string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error) {
 	wc := c.Watch(context.Background(), key, clientv3.WithRev(rev))
 	wc := c.Watch(context.Background(), key, clientv3.WithRev(rev))
 	if wc == nil {
 	if wc == nil {
 		return nil, ErrNoWatcher
 		return nil, ErrNoWatcher
@@ -29,7 +29,7 @@ func WaitEvents(c *clientv3.Client, key string, rev int64, evs []storagepb.Event
 	return waitEvents(wc, evs), nil
 	return waitEvents(wc, evs), nil
 }
 }
 
 
-func WaitPrefixEvents(c *clientv3.Client, prefix string, rev int64, evs []storagepb.Event_EventType) (*clientv3.Event, error) {
+func WaitPrefixEvents(c *clientv3.Client, prefix string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error) {
 	wc := c.Watch(context.Background(), prefix, clientv3.WithPrefix(), clientv3.WithRev(rev))
 	wc := c.Watch(context.Background(), prefix, clientv3.WithPrefix(), clientv3.WithRev(rev))
 	if wc == nil {
 	if wc == nil {
 		return nil, ErrNoWatcher
 		return nil, ErrNoWatcher
@@ -37,7 +37,7 @@ func WaitPrefixEvents(c *clientv3.Client, prefix string, rev int64, evs []storag
 	return waitEvents(wc, evs), nil
 	return waitEvents(wc, evs), nil
 }
 }
 
 
-func waitEvents(wc clientv3.WatchChan, evs []storagepb.Event_EventType) *clientv3.Event {
+func waitEvents(wc clientv3.WatchChan, evs []mvccpb.Event_EventType) *clientv3.Event {
 	i := 0
 	i := 0
 	for wresp := range wc {
 	for wresp := range wc {
 		for _, ev := range wresp.Events {
 		for _, ev := range wresp.Events {

+ 2 - 2
e2e/ctl_v3_alarm_test.go

@@ -31,7 +31,7 @@ func alarmTest(cx ctlCtx) {
 	// test big put (to be rejected, and trigger quota alarm)
 	// test big put (to be rejected, and trigger quota alarm)
 	bigbuf := strings.Repeat("a", int(cx.quotaBackendBytes))
 	bigbuf := strings.Repeat("a", int(cx.quotaBackendBytes))
 	if err := ctlV3Put(cx, "abc", bigbuf, ""); err != nil {
 	if err := ctlV3Put(cx, "abc", bigbuf, ""); err != nil {
-		if !strings.Contains(err.Error(), "etcdserver: storage: database space exceeded") {
+		if !strings.Contains(err.Error(), "etcdserver: mvcc: database space exceeded") {
 			cx.t.Fatal(err)
 			cx.t.Fatal(err)
 		}
 		}
 	}
 	}
@@ -41,7 +41,7 @@ func alarmTest(cx ctlCtx) {
 
 
 	// alarm is on rejecting Puts and Txns
 	// alarm is on rejecting Puts and Txns
 	if err := ctlV3Put(cx, "def", smallbuf, ""); err != nil {
 	if err := ctlV3Put(cx, "def", smallbuf, ""); err != nil {
-		if !strings.Contains(err.Error(), "etcdserver: storage: database space exceeded") {
+		if !strings.Contains(err.Error(), "etcdserver: mvcc: database space exceeded") {
 			cx.t.Fatal(err)
 			cx.t.Fatal(err)
 		}
 		}
 	}
 	}

+ 1 - 1
etcdctl/READMEv3.md

@@ -723,7 +723,7 @@ On success, prints a line of JSON encoding the database hash, revision, total ke
 
 
 
 
 [etcdrpc]: ../etcdserver/etcdserverpb/rpc.proto
 [etcdrpc]: ../etcdserver/etcdserverpb/rpc.proto
-[storagerpc]: ../storage/storagepb/kv.proto
+[storagerpc]: ../mvcc/mvccpb/kv.proto
 
 
 ## Compatibility Support
 ## Compatibility Support
 
 

+ 3 - 3
etcdctl/ctlv3/command/make_mirror_command.go

@@ -23,7 +23,7 @@ import (
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/clientv3/mirror"
 	"github.com/coreos/etcd/clientv3/mirror"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
@@ -125,10 +125,10 @@ func makeMirror(ctx context.Context, c *clientv3.Client, dc *clientv3.Client) er
 				ops = []clientv3.Op{}
 				ops = []clientv3.Op{}
 			}
 			}
 			switch ev.Type {
 			switch ev.Type {
-			case storagepb.PUT:
+			case mvccpb.PUT:
 				ops = append(ops, clientv3.OpPut(string(ev.Kv.Key), string(ev.Kv.Value)))
 				ops = append(ops, clientv3.OpPut(string(ev.Kv.Key), string(ev.Kv.Value)))
 				atomic.AddInt64(&total, 1)
 				atomic.AddInt64(&total, 1)
-			case storagepb.DELETE, storagepb.EXPIRE:
+			case mvccpb.DELETE, mvccpb.EXPIRE:
 				ops = append(ops, clientv3.OpDelete(string(ev.Kv.Key)))
 				ops = append(ops, clientv3.OpDelete(string(ev.Kv.Key)))
 				atomic.AddInt64(&total, 1)
 				atomic.AddInt64(&total, 1)
 			default:
 			default:

+ 1 - 1
etcdctl/ctlv3/command/printer.go

@@ -23,7 +23,7 @@ import (
 
 
 	v3 "github.com/coreos/etcd/clientv3"
 	v3 "github.com/coreos/etcd/clientv3"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
-	spb "github.com/coreos/etcd/storage/storagepb"
+	spb "github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/dustin/go-humanize"
 	"github.com/dustin/go-humanize"
 	"github.com/olekukonko/tablewriter"
 	"github.com/olekukonko/tablewriter"
 )
 )

+ 3 - 3
etcdctl/ctlv3/command/snapshot_command.go

@@ -28,12 +28,12 @@ import (
 	"github.com/coreos/etcd/etcdserver"
 	"github.com/coreos/etcd/etcdserver"
 	"github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/etcdserver/membership"
 	"github.com/coreos/etcd/etcdserver/membership"
+	"github.com/coreos/etcd/mvcc"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/fileutil"
 	"github.com/coreos/etcd/pkg/fileutil"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/raft"
 	"github.com/coreos/etcd/raft"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/raft/raftpb"
-	"github.com/coreos/etcd/storage"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/etcd/wal"
 	"github.com/coreos/etcd/wal"
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
@@ -275,7 +275,7 @@ func makeDB(snapdir, dbfile string) {
 	// update consistentIndex so applies go through on etcdserver despite
 	// update consistentIndex so applies go through on etcdserver despite
 	// having a new raft instance
 	// having a new raft instance
 	be := backend.NewDefaultBackend(dbpath)
 	be := backend.NewDefaultBackend(dbpath)
-	s := storage.NewStore(be, nil, &initIndex{})
+	s := mvcc.NewStore(be, nil, &initIndex{})
 	id := s.TxnBegin()
 	id := s.TxnBegin()
 	btx := be.BatchTx()
 	btx := be.BatchTx()
 	del := func(k, v []byte) error {
 	del := func(k, v []byte) error {

+ 1 - 1
etcdctl/ctlv3/command/util.go

@@ -19,7 +19,7 @@ import (
 	"fmt"
 	"fmt"
 	"regexp"
 	"regexp"
 
 
-	pb "github.com/coreos/etcd/storage/storagepb"
+	pb "github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )

+ 1 - 1
etcdserver/api/v3rpc/maintenance.go

@@ -19,8 +19,8 @@ import (
 
 
 	"github.com/coreos/etcd/etcdserver"
 	"github.com/coreos/etcd/etcdserver"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/pkg/types"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/etcd/version"
 	"github.com/coreos/etcd/version"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )

+ 3 - 3
etcdserver/api/v3rpc/rpctypes/error.go

@@ -23,9 +23,9 @@ var (
 	ErrEmptyKey     = grpc.Errorf(codes.InvalidArgument, "etcdserver: key is not provided")
 	ErrEmptyKey     = grpc.Errorf(codes.InvalidArgument, "etcdserver: key is not provided")
 	ErrTooManyOps   = grpc.Errorf(codes.InvalidArgument, "etcdserver: too many operations in txn request")
 	ErrTooManyOps   = grpc.Errorf(codes.InvalidArgument, "etcdserver: too many operations in txn request")
 	ErrDuplicateKey = grpc.Errorf(codes.InvalidArgument, "etcdserver: duplicate key given in txn request")
 	ErrDuplicateKey = grpc.Errorf(codes.InvalidArgument, "etcdserver: duplicate key given in txn request")
-	ErrCompacted    = grpc.Errorf(codes.OutOfRange, "etcdserver: storage: required revision has been compacted")
-	ErrFutureRev    = grpc.Errorf(codes.OutOfRange, "etcdserver: storage: required revision is a future revision")
-	ErrNoSpace      = grpc.Errorf(codes.ResourceExhausted, "etcdserver: storage: database space exceeded")
+	ErrCompacted    = grpc.Errorf(codes.OutOfRange, "etcdserver: mvcc: required revision has been compacted")
+	ErrFutureRev    = grpc.Errorf(codes.OutOfRange, "etcdserver: mvcc: required revision is a future revision")
+	ErrNoSpace      = grpc.Errorf(codes.ResourceExhausted, "etcdserver: mvcc: database space exceeded")
 
 
 	ErrLeaseNotFound = grpc.Errorf(codes.NotFound, "etcdserver: requested lease not found")
 	ErrLeaseNotFound = grpc.Errorf(codes.NotFound, "etcdserver: requested lease not found")
 	ErrLeaseExist    = grpc.Errorf(codes.FailedPrecondition, "etcdserver: lease already exists")
 	ErrLeaseExist    = grpc.Errorf(codes.FailedPrecondition, "etcdserver: lease already exists")

+ 3 - 3
etcdserver/api/v3rpc/util.go

@@ -19,16 +19,16 @@ import (
 	"github.com/coreos/etcd/etcdserver"
 	"github.com/coreos/etcd/etcdserver"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage"
+	"github.com/coreos/etcd/mvcc"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/codes"
 )
 )
 
 
 func togRPCError(err error) error {
 func togRPCError(err error) error {
 	switch err {
 	switch err {
-	case storage.ErrCompacted:
+	case mvcc.ErrCompacted:
 		return rpctypes.ErrCompacted
 		return rpctypes.ErrCompacted
-	case storage.ErrFutureRev:
+	case mvcc.ErrFutureRev:
 		return rpctypes.ErrFutureRev
 		return rpctypes.ErrFutureRev
 	case lease.ErrLeaseNotFound:
 	case lease.ErrLeaseNotFound:
 		return rpctypes.ErrLeaseNotFound
 		return rpctypes.ErrLeaseNotFound

+ 20 - 20
etcdserver/api/v3rpc/watch.go

@@ -21,15 +21,15 @@ import (
 
 
 	"github.com/coreos/etcd/etcdserver"
 	"github.com/coreos/etcd/etcdserver"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
-	"github.com/coreos/etcd/storage"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 )
 )
 
 
 type watchServer struct {
 type watchServer struct {
 	clusterID int64
 	clusterID int64
 	memberID  int64
 	memberID  int64
 	raftTimer etcdserver.RaftTimer
 	raftTimer etcdserver.RaftTimer
-	watchable storage.Watchable
+	watchable mvcc.Watchable
 }
 }
 
 
 func NewWatchServer(s *etcdserver.EtcdServer) pb.WatchServer {
 func NewWatchServer(s *etcdserver.EtcdServer) pb.WatchServer {
@@ -71,7 +71,7 @@ const (
 )
 )
 
 
 // serverWatchStream is an etcd server side stream. It receives requests
 // serverWatchStream is an etcd server side stream. It receives requests
-// from client side gRPC stream. It receives watch events from storage.WatchStream,
+// from client side gRPC stream. It receives watch events from mvcc.WatchStream,
 // and creates responses that forwarded to gRPC stream.
 // and creates responses that forwarded to gRPC stream.
 // It also forwards control message like watch created and canceled.
 // It also forwards control message like watch created and canceled.
 type serverWatchStream struct {
 type serverWatchStream struct {
@@ -80,12 +80,12 @@ type serverWatchStream struct {
 	raftTimer etcdserver.RaftTimer
 	raftTimer etcdserver.RaftTimer
 
 
 	gRPCStream  pb.Watch_WatchServer
 	gRPCStream  pb.Watch_WatchServer
-	watchStream storage.WatchStream
+	watchStream mvcc.WatchStream
 	ctrlStream  chan *pb.WatchResponse
 	ctrlStream  chan *pb.WatchResponse
 
 
 	// progress tracks the watchID that stream might need to send
 	// progress tracks the watchID that stream might need to send
 	// progress to.
 	// progress to.
-	progress map[storage.WatchID]bool
+	progress map[mvcc.WatchID]bool
 	// mu protects progress
 	// mu protects progress
 	mu sync.Mutex
 	mu sync.Mutex
 
 
@@ -102,7 +102,7 @@ func (ws *watchServer) Watch(stream pb.Watch_WatchServer) error {
 		watchStream: ws.watchable.NewWatchStream(),
 		watchStream: ws.watchable.NewWatchStream(),
 		// chan for sending control response like watcher created and canceled.
 		// chan for sending control response like watcher created and canceled.
 		ctrlStream: make(chan *pb.WatchResponse, ctrlStreamBufLen),
 		ctrlStream: make(chan *pb.WatchResponse, ctrlStreamBufLen),
-		progress:   make(map[storage.WatchID]bool),
+		progress:   make(map[mvcc.WatchID]bool),
 		closec:     make(chan struct{}),
 		closec:     make(chan struct{}),
 	}
 	}
 	defer sws.close()
 	defer sws.close()
@@ -154,7 +154,7 @@ func (sws *serverWatchStream) recvLoop() error {
 		case *pb.WatchRequest_CancelRequest:
 		case *pb.WatchRequest_CancelRequest:
 			if uv.CancelRequest != nil {
 			if uv.CancelRequest != nil {
 				id := uv.CancelRequest.WatchId
 				id := uv.CancelRequest.WatchId
-				err := sws.watchStream.Cancel(storage.WatchID(id))
+				err := sws.watchStream.Cancel(mvcc.WatchID(id))
 				if err == nil {
 				if err == nil {
 					sws.ctrlStream <- &pb.WatchResponse{
 					sws.ctrlStream <- &pb.WatchResponse{
 						Header:   sws.newResponseHeader(sws.watchStream.Rev()),
 						Header:   sws.newResponseHeader(sws.watchStream.Rev()),
@@ -162,7 +162,7 @@ func (sws *serverWatchStream) recvLoop() error {
 						Canceled: true,
 						Canceled: true,
 					}
 					}
 					sws.mu.Lock()
 					sws.mu.Lock()
-					delete(sws.progress, storage.WatchID(id))
+					delete(sws.progress, mvcc.WatchID(id))
 					sws.mu.Unlock()
 					sws.mu.Unlock()
 				}
 				}
 			}
 			}
@@ -175,9 +175,9 @@ func (sws *serverWatchStream) recvLoop() error {
 
 
 func (sws *serverWatchStream) sendLoop() {
 func (sws *serverWatchStream) sendLoop() {
 	// watch ids that are currently active
 	// watch ids that are currently active
-	ids := make(map[storage.WatchID]struct{})
+	ids := make(map[mvcc.WatchID]struct{})
 	// watch responses pending on a watch id creation message
 	// watch responses pending on a watch id creation message
-	pending := make(map[storage.WatchID][]*pb.WatchResponse)
+	pending := make(map[mvcc.WatchID][]*pb.WatchResponse)
 
 
 	interval := GetProgressReportInterval()
 	interval := GetProgressReportInterval()
 	progressTicker := time.NewTicker(interval)
 	progressTicker := time.NewTicker(interval)
@@ -190,11 +190,11 @@ func (sws *serverWatchStream) sendLoop() {
 				return
 				return
 			}
 			}
 
 
-			// TODO: evs is []storagepb.Event type
-			// either return []*storagepb.Event from storage package
-			// or define protocol buffer with []storagepb.Event.
+			// TODO: evs is []mvccpb.Event type
+			// either return []*mvccpb.Event from the mvcc package
+			// or define protocol buffer with []mvccpb.Event.
 			evs := wresp.Events
 			evs := wresp.Events
-			events := make([]*storagepb.Event, len(evs))
+			events := make([]*mvccpb.Event, len(evs))
 			for i := range evs {
 			for i := range evs {
 				events[i] = &evs[i]
 				events[i] = &evs[i]
 			}
 			}
@@ -213,7 +213,7 @@ func (sws *serverWatchStream) sendLoop() {
 				continue
 				continue
 			}
 			}
 
 
-			storage.ReportEventReceived()
+			mvcc.ReportEventReceived()
 			if err := sws.gRPCStream.Send(wr); err != nil {
 			if err := sws.gRPCStream.Send(wr); err != nil {
 				return
 				return
 			}
 			}
@@ -234,7 +234,7 @@ func (sws *serverWatchStream) sendLoop() {
 			}
 			}
 
 
 			// track id creation
 			// track id creation
-			wid := storage.WatchID(c.WatchId)
+			wid := mvcc.WatchID(c.WatchId)
 			if c.Canceled {
 			if c.Canceled {
 				delete(ids, wid)
 				delete(ids, wid)
 				continue
 				continue
@@ -243,7 +243,7 @@ func (sws *serverWatchStream) sendLoop() {
 				// flush buffered events
 				// flush buffered events
 				ids[wid] = struct{}{}
 				ids[wid] = struct{}{}
 				for _, v := range pending[wid] {
 				for _, v := range pending[wid] {
-					storage.ReportEventReceived()
+					mvcc.ReportEventReceived()
 					if err := sws.gRPCStream.Send(v); err != nil {
 					if err := sws.gRPCStream.Send(v); err != nil {
 						return
 						return
 					}
 					}
@@ -260,11 +260,11 @@ func (sws *serverWatchStream) sendLoop() {
 		case <-sws.closec:
 		case <-sws.closec:
 			// drain the chan to clean up pending events
 			// drain the chan to clean up pending events
 			for range sws.watchStream.Chan() {
 			for range sws.watchStream.Chan() {
-				storage.ReportEventReceived()
+				mvcc.ReportEventReceived()
 			}
 			}
 			for _, wrs := range pending {
 			for _, wrs := range pending {
 				for range wrs {
 				for range wrs {
-					storage.ReportEventReceived()
+					mvcc.ReportEventReceived()
 				}
 				}
 			}
 			}
 		}
 		}

+ 8 - 8
etcdserver/apply.go

@@ -21,9 +21,9 @@ import (
 
 
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
+	"github.com/coreos/etcd/mvcc"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/pkg/types"
-	dstorage "github.com/coreos/etcd/storage"
-	"github.com/coreos/etcd/storage/storagepb"
 	"github.com/gogo/protobuf/proto"
 	"github.com/gogo/protobuf/proto"
 )
 )
 
 
@@ -166,7 +166,7 @@ func (a *applierV3backend) Range(txnID int64, r *pb.RangeRequest) (*pb.RangeResp
 	resp.Header = &pb.ResponseHeader{}
 	resp.Header = &pb.ResponseHeader{}
 
 
 	var (
 	var (
-		kvs []storagepb.KeyValue
+		kvs []mvccpb.KeyValue
 		rev int64
 		rev int64
 		err error
 		err error
 	)
 	)
@@ -292,12 +292,12 @@ func (a *applierV3backend) Txn(rt *pb.TxnRequest) (*pb.TxnResponse, error) {
 func (a *applierV3backend) applyCompare(c *pb.Compare) (int64, bool) {
 func (a *applierV3backend) applyCompare(c *pb.Compare) (int64, bool) {
 	ckvs, rev, err := a.s.KV().Range(c.Key, nil, 1, 0)
 	ckvs, rev, err := a.s.KV().Range(c.Key, nil, 1, 0)
 	if err != nil {
 	if err != nil {
-		if err == dstorage.ErrTxnIDMismatch {
+		if err == mvcc.ErrTxnIDMismatch {
 			panic("unexpected txn ID mismatch error")
 			panic("unexpected txn ID mismatch error")
 		}
 		}
 		return rev, false
 		return rev, false
 	}
 	}
-	var ckv storagepb.KeyValue
+	var ckv mvccpb.KeyValue
 	if len(ckvs) != 0 {
 	if len(ckvs) != 0 {
 		ckv = ckvs[0]
 		ckv = ckvs[0]
 	} else {
 	} else {
@@ -557,7 +557,7 @@ func (a *quotaApplierV3) LeaseGrant(lc *pb.LeaseGrantRequest) (*pb.LeaseGrantRes
 	return resp, err
 	return resp, err
 }
 }
 
 
-type kvSort struct{ kvs []storagepb.KeyValue }
+type kvSort struct{ kvs []mvccpb.KeyValue }
 
 
 func (s *kvSort) Swap(i, j int) {
 func (s *kvSort) Swap(i, j int) {
 	t := s.kvs[i]
 	t := s.kvs[i]
@@ -625,10 +625,10 @@ func (a *applierV3backend) checkRequestRange(reqs []*pb.RequestUnion) error {
 		}
 		}
 
 
 		if greq.Revision > a.s.KV().Rev() {
 		if greq.Revision > a.s.KV().Rev() {
-			return dstorage.ErrFutureRev
+			return mvcc.ErrFutureRev
 		}
 		}
 		if greq.Revision < a.s.KV().FirstRev() {
 		if greq.Revision < a.s.KV().FirstRev() {
-			return dstorage.ErrCompacted
+			return mvcc.ErrCompacted
 		}
 		}
 	}
 	}
 	return nil
 	return nil

+ 1 - 1
etcdserver/consistent_index.go

@@ -19,7 +19,7 @@ import (
 )
 )
 
 
 // consistentIndex represents the offset of an entry in a consistent replica log.
 // consistentIndex represents the offset of an entry in a consistent replica log.
-// It implements the storage.ConsistentIndexGetter interface.
+// It implements the mvcc.ConsistentIndexGetter interface.
 // It is always set to the offset of current entry before executing the entry,
 // It is always set to the offset of current entry before executing the entry,
 // so ConsistentWatchableKV could get the consistent index from it.
 // so ConsistentWatchableKV could get the consistent index from it.
 type consistentIndex uint64
 type consistentIndex uint64

+ 40 - 45
etcdserver/etcdserverpb/etcdserver.pb.go

@@ -110,23 +110,23 @@ var _ = math.Inf
 const _ = proto.GoGoProtoPackageIsVersion1
 const _ = proto.GoGoProtoPackageIsVersion1
 
 
 type Request struct {
 type Request struct {
-	ID               uint64 `protobuf:"varint,1,opt,name=ID,json=iD" json:"ID"`
-	Method           string `protobuf:"bytes,2,opt,name=Method,json=method" json:"Method"`
-	Path             string `protobuf:"bytes,3,opt,name=Path,json=path" json:"Path"`
-	Val              string `protobuf:"bytes,4,opt,name=Val,json=val" json:"Val"`
-	Dir              bool   `protobuf:"varint,5,opt,name=Dir,json=dir" json:"Dir"`
-	PrevValue        string `protobuf:"bytes,6,opt,name=PrevValue,json=prevValue" json:"PrevValue"`
-	PrevIndex        uint64 `protobuf:"varint,7,opt,name=PrevIndex,json=prevIndex" json:"PrevIndex"`
-	PrevExist        *bool  `protobuf:"varint,8,opt,name=PrevExist,json=prevExist" json:"PrevExist,omitempty"`
-	Expiration       int64  `protobuf:"varint,9,opt,name=Expiration,json=expiration" json:"Expiration"`
-	Wait             bool   `protobuf:"varint,10,opt,name=Wait,json=wait" json:"Wait"`
-	Since            uint64 `protobuf:"varint,11,opt,name=Since,json=since" json:"Since"`
-	Recursive        bool   `protobuf:"varint,12,opt,name=Recursive,json=recursive" json:"Recursive"`
-	Sorted           bool   `protobuf:"varint,13,opt,name=Sorted,json=sorted" json:"Sorted"`
-	Quorum           bool   `protobuf:"varint,14,opt,name=Quorum,json=quorum" json:"Quorum"`
-	Time             int64  `protobuf:"varint,15,opt,name=Time,json=time" json:"Time"`
-	Stream           bool   `protobuf:"varint,16,opt,name=Stream,json=stream" json:"Stream"`
-	Refresh          *bool  `protobuf:"varint,17,opt,name=Refresh,json=refresh" json:"Refresh,omitempty"`
+	ID               uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"`
+	Method           string `protobuf:"bytes,2,opt,name=Method" json:"Method"`
+	Path             string `protobuf:"bytes,3,opt,name=Path" json:"Path"`
+	Val              string `protobuf:"bytes,4,opt,name=Val" json:"Val"`
+	Dir              bool   `protobuf:"varint,5,opt,name=Dir" json:"Dir"`
+	PrevValue        string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"`
+	PrevIndex        uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"`
+	PrevExist        *bool  `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"`
+	Expiration       int64  `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"`
+	Wait             bool   `protobuf:"varint,10,opt,name=Wait" json:"Wait"`
+	Since            uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"`
+	Recursive        bool   `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"`
+	Sorted           bool   `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"`
+	Quorum           bool   `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"`
+	Time             int64  `protobuf:"varint,15,opt,name=Time" json:"Time"`
+	Stream           bool   `protobuf:"varint,16,opt,name=Stream" json:"Stream"`
+	Refresh          *bool  `protobuf:"varint,17,opt,name=Refresh" json:"Refresh,omitempty"`
 	XXX_unrecognized []byte `json:"-"`
 	XXX_unrecognized []byte `json:"-"`
 }
 }
 
 
@@ -136,8 +136,8 @@ func (*Request) ProtoMessage()               {}
 func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{0} }
 func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{0} }
 
 
 type Metadata struct {
 type Metadata struct {
-	NodeID           uint64 `protobuf:"varint,1,opt,name=NodeID,json=nodeID" json:"NodeID"`
-	ClusterID        uint64 `protobuf:"varint,2,opt,name=ClusterID,json=clusterID" json:"ClusterID"`
+	NodeID           uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"`
+	ClusterID        uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"`
 	XXX_unrecognized []byte `json:"-"`
 	XXX_unrecognized []byte `json:"-"`
 }
 }
 
 
@@ -1005,30 +1005,25 @@ var (
 )
 )
 
 
 var fileDescriptorEtcdserver = []byte{
 var fileDescriptorEtcdserver = []byte{
-	// 388 bytes of a gzipped FileDescriptorProto
-	0x1f, 0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 0xbd, 0x3b, 0xff, 0x9e,
-	0x46, 0xdf, 0xed, 0xf9, 0x69, 0xcf, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x8e, 0x1a, 0x0d,
-	0xa0, 0x02, 0x00, 0x00,
+	// 320 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x91, 0x4f, 0x4f, 0xf2, 0x40,
+	0x10, 0xc6, 0x69, 0x29, 0xff, 0xf6, 0xe5, 0xd5, 0x52, 0x31, 0x4e, 0x3c, 0xa0, 0xe1, 0xe4, 0x49,
+	0xcf, 0x5e, 0x11, 0x0e, 0x1c, 0x34, 0x08, 0x46, 0xcf, 0x2b, 0x1d, 0x61, 0x13, 0x60, 0x71, 0x3a,
+	0x4b, 0xf8, 0x88, 0x1c, 0xfd, 0x04, 0x46, 0xfd, 0x22, 0xba, 0xd5, 0xc6, 0x6e, 0x3d, 0x6c, 0xd2,
+	0xfc, 0x9e, 0x67, 0x66, 0x9e, 0x99, 0x8a, 0x10, 0x79, 0x1a, 0x27, 0x48, 0x1b, 0xa4, 0xf3, 0x35,
+	0x69, 0xd6, 0x51, 0x33, 0x27, 0xeb, 0xc7, 0xe3, 0xf6, 0x4c, 0xcf, 0xf4, 0xb7, 0x70, 0x91, 0x7e,
+	0xfd, 0x78, 0xba, 0x9f, 0xbe, 0xa8, 0x8d, 0xf1, 0xd9, 0x60, 0xc2, 0x51, 0x28, 0xfc, 0x61, 0x1f,
+	0xbc, 0x53, 0xef, 0x2c, 0xe8, 0x05, 0xbb, 0xd7, 0x93, 0x52, 0xd4, 0x16, 0xd5, 0x6b, 0xe4, 0xb9,
+	0x8e, 0xc1, 0xb7, 0xb4, 0x91, 0xd1, 0x48, 0x04, 0x23, 0xc9, 0x73, 0x28, 0x3b, 0xac, 0x25, 0xca,
+	0xf7, 0x72, 0x01, 0x41, 0x11, 0xf5, 0x15, 0x41, 0xc5, 0xa2, 0x7a, 0x86, 0x8e, 0x44, 0x63, 0x44,
+	0xb8, 0xb1, 0x4e, 0x83, 0x50, 0x75, 0xbc, 0x99, 0x30, 0x5c, 0xc5, 0xb8, 0x85, 0x9a, 0x93, 0x20,
+	0x13, 0x06, 0x5b, 0x95, 0x30, 0xd4, 0x7f, 0x5b, 0x79, 0x11, 0x08, 0x31, 0xd8, 0xae, 0x15, 0x49,
+	0x56, 0x7a, 0x05, 0x0d, 0xab, 0x94, 0xf3, 0x78, 0x0f, 0x52, 0x31, 0x08, 0x67, 0xf0, 0x81, 0xa8,
+	0x4c, 0xd4, 0x6a, 0x8a, 0xf0, 0xaf, 0xd8, 0x7b, 0x8c, 0x53, 0x43, 0x89, 0xda, 0x20, 0x34, 0x1d,
+	0xb7, 0x5d, 0x7b, 0xa2, 0x89, 0x31, 0x86, 0xff, 0x45, 0x7a, 0x6b, 0x34, 0x99, 0x25, 0xec, 0x39,
+	0xd4, 0x4e, 0xbb, 0x53, 0x4b, 0x84, 0x7d, 0x27, 0x41, 0x5a, 0xcf, 0x84, 0x72, 0x09, 0xa1, 0xe3,
+	0x3c, 0x4c, 0x2f, 0xfd, 0x44, 0x98, 0xcc, 0xa1, 0x95, 0x2f, 0xd2, 0xbd, 0x14, 0x75, 0x7b, 0x63,
+	0x19, 0x4b, 0x96, 0x69, 0xe1, 0x8d, 0x8e, 0xf1, 0xcf, 0x5f, 0xb0, 0x39, 0xaf, 0x16, 0x26, 0x61,
+	0x24, 0x2b, 0xf8, 0xb9, 0xd0, 0x0b, 0x77, 0xef, 0x9d, 0xd2, 0xee, 0xa3, 0xe3, 0xbd, 0xd8, 0xf7,
+	0x66, 0xdf, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x78, 0xf7, 0x38, 0x05, 0x02, 0x00, 0x00,
 }
 }

+ 42 - 46
etcdserver/etcdserverpb/raft_internal.pb.go

@@ -22,22 +22,22 @@ var _ = math.Inf
 // An InternalRaftRequest is the union of all requests which can be
 // An InternalRaftRequest is the union of all requests which can be
 // sent via raft.
 // sent via raft.
 type InternalRaftRequest struct {
 type InternalRaftRequest struct {
-	ID                     uint64                         `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID                     uint64                         `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
 	V2                     *Request                       `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"`
 	V2                     *Request                       `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"`
 	Range                  *RangeRequest                  `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"`
 	Range                  *RangeRequest                  `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"`
 	Put                    *PutRequest                    `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"`
 	Put                    *PutRequest                    `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"`
-	DeleteRange            *DeleteRangeRequest            `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"`
+	DeleteRange            *DeleteRangeRequest            `protobuf:"bytes,5,opt,name=delete_range" json:"delete_range,omitempty"`
 	Txn                    *TxnRequest                    `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"`
 	Txn                    *TxnRequest                    `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"`
 	Compaction             *CompactionRequest             `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"`
 	Compaction             *CompactionRequest             `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"`
-	LeaseGrant             *LeaseGrantRequest             `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"`
-	LeaseRevoke            *LeaseRevokeRequest            `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"`
-	AuthEnable             *AuthEnableRequest             `protobuf:"bytes,10,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"`
-	AuthUserAdd            *AuthUserAddRequest            `protobuf:"bytes,11,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"`
-	AuthUserDelete         *AuthUserDeleteRequest         `protobuf:"bytes,12,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"`
-	AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,13,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"`
-	AuthUserGrant          *AuthUserGrantRequest          `protobuf:"bytes,14,opt,name=auth_user_grant,json=authUserGrant" json:"auth_user_grant,omitempty"`
-	AuthRoleAdd            *AuthRoleAddRequest            `protobuf:"bytes,15,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"`
-	AuthRoleGrant          *AuthRoleGrantRequest          `protobuf:"bytes,16,opt,name=auth_role_grant,json=authRoleGrant" json:"auth_role_grant,omitempty"`
+	LeaseGrant             *LeaseGrantRequest             `protobuf:"bytes,8,opt,name=lease_grant" json:"lease_grant,omitempty"`
+	LeaseRevoke            *LeaseRevokeRequest            `protobuf:"bytes,9,opt,name=lease_revoke" json:"lease_revoke,omitempty"`
+	AuthEnable             *AuthEnableRequest             `protobuf:"bytes,10,opt,name=auth_enable" json:"auth_enable,omitempty"`
+	AuthUserAdd            *AuthUserAddRequest            `protobuf:"bytes,11,opt,name=auth_user_add" json:"auth_user_add,omitempty"`
+	AuthUserDelete         *AuthUserDeleteRequest         `protobuf:"bytes,12,opt,name=auth_user_delete" json:"auth_user_delete,omitempty"`
+	AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,13,opt,name=auth_user_change_password" json:"auth_user_change_password,omitempty"`
+	AuthUserGrant          *AuthUserGrantRequest          `protobuf:"bytes,14,opt,name=auth_user_grant" json:"auth_user_grant,omitempty"`
+	AuthRoleAdd            *AuthRoleAddRequest            `protobuf:"bytes,15,opt,name=auth_role_add" json:"auth_role_add,omitempty"`
+	AuthRoleGrant          *AuthRoleGrantRequest          `protobuf:"bytes,16,opt,name=auth_role_grant" json:"auth_role_grant,omitempty"`
 	Authenticate           *AuthenticateRequest           `protobuf:"bytes,17,opt,name=authenticate" json:"authenticate,omitempty"`
 	Authenticate           *AuthenticateRequest           `protobuf:"bytes,17,opt,name=authenticate" json:"authenticate,omitempty"`
 	Alarm                  *AlarmRequest                  `protobuf:"bytes,18,opt,name=alarm" json:"alarm,omitempty"`
 	Alarm                  *AlarmRequest                  `protobuf:"bytes,18,opt,name=alarm" json:"alarm,omitempty"`
 }
 }
@@ -1185,39 +1185,35 @@ var (
 )
 )
 
 
 var fileDescriptorRaftInternal = []byte{
 var fileDescriptorRaftInternal = []byte{
-	// 534 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x94, 0xdf, 0x6e, 0xd3, 0x30,
-	0x14, 0xc6, 0x69, 0xf7, 0x87, 0xcd, 0xfd, 0x8b, 0x07, 0xc8, 0xf4, 0x62, 0x8c, 0x22, 0x24, 0x04,
-	0x52, 0x41, 0xe3, 0x01, 0xa0, 0xb4, 0x15, 0x1a, 0x02, 0x69, 0x8a, 0xe0, 0x3a, 0x72, 0x93, 0xb3,
-	0xae, 0x22, 0x8d, 0x83, 0xe3, 0x94, 0xf1, 0x86, 0xbb, 0xe4, 0x11, 0x80, 0xb7, 0xe0, 0x0e, 0xfb,
-	0x24, 0x71, 0x9a, 0xcd, 0xbd, 0xa8, 0x94, 0x7c, 0xe7, 0x3b, 0xbf, 0xf3, 0xc5, 0x47, 0x2e, 0x39,
-	0x92, 0xfc, 0x42, 0xf9, 0xcb, 0x58, 0x81, 0x8c, 0x79, 0x34, 0x4a, 0xa4, 0x50, 0x82, 0xb6, 0x41,
-	0x05, 0x61, 0x0a, 0x72, 0x0d, 0x32, 0x99, 0x0f, 0xee, 0x2f, 0xc4, 0x42, 0x60, 0xe1, 0x95, 0x79,
-	0xca, 0x3d, 0x83, 0x7e, 0xe5, 0x29, 0x94, 0x43, 0x99,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-	0x8f, 0x4d, 0xc9, 0x5e, 0x7d, 0x34, 0x0e, 0x7b, 0xa4, 0x33, 0x5b, 0x25, 0xea, 0xa7, 0x07, 0x69,
-	0x22, 0xe2, 0x14, 0xde, 0xf7, 0xaf, 0xff, 0x1c, 0xdf, 0xb9, 0xfe, 0x7b, 0xdc, 0xf8, 0xa5, 0x7f,
-	0xbf, 0xf5, 0x6f, 0xbe, 0x8f, 0xff, 0x52, 0x6f, 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0xee, 0xd7,
-	0xc5, 0x26, 0xfd, 0x04, 0x00, 0x00,
+	// 473 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x93, 0xdf, 0x6e, 0xd3, 0x30,
+	0x14, 0xc6, 0x69, 0xf7, 0x8f, 0x9d, 0xb6, 0xb4, 0x74, 0x20, 0x99, 0x5e, 0x8c, 0xad, 0x08, 0x09,
+	0x84, 0x54, 0xa4, 0x0d, 0xc1, 0x05, 0xe2, 0xa2, 0x6c, 0x13, 0x9a, 0x84, 0xd0, 0x14, 0xc1, 0x75,
+	0xe4, 0x26, 0x87, 0xae, 0x22, 0xb5, 0x83, 0xe3, 0x94, 0xf1, 0x50, 0xbc, 0xc7, 0x2e, 0x79, 0x04,
+	0xe0, 0x49, 0xb0, 0x4f, 0xe2, 0x35, 0xe9, 0xdc, 0x8b, 0x48, 0xde, 0xce, 0xef, 0xf7, 0x9d, 0xe4,
+	0xab, 0x0c, 0x7b, 0x8a, 0x7f, 0xd5, 0xe1, 0x4c, 0x68, 0x54, 0x82, 0x27, 0xa3, 0x54, 0x49, 0x2d,
+	0xfb, 0x6d, 0xd4, 0x51, 0x9c, 0xa1, 0x5a, 0xa0, 0x4a, 0x27, 0x83, 0x07, 0x53, 0x39, 0x95, 0x34,
+	0x78, 0x69, 0x4f, 0x05, 0x33, 0xe8, 0x2d, 0x99, 0xf2, 0x3f, 0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7 +16,7 @@ import (
 	io "io"
 	io "io"
 )
 )
 
 
-import storagepb "github.com/coreos/etcd/storage/storagepb"
+import mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
 
 
 import (
 import (
 	context "golang.org/x/net/context"
 	context "golang.org/x/net/context"
@@ -182,13 +182,13 @@ func (AlarmRequest_AlarmAction) EnumDescriptor() ([]byte, []int) {
 
 
 type ResponseHeader struct {
 type ResponseHeader struct {
 	// cluster_id is the ID of the cluster which sent the response.
 	// cluster_id is the ID of the cluster which sent the response.
-	ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
+	ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
 	// member_id is the ID of the member which sent the response.
 	// member_id is the ID of the member which sent the response.
-	MemberId uint64 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"`
+	MemberId uint64 `protobuf:"varint,2,opt,name=member_id,proto3" json:"member_id,omitempty"`
 	// revision is the key-value store revision when the request was applied.
 	// revision is the key-value store revision when the request was applied.
 	Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
 	Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
 	// raft_term is the raft term when the request was applied.
 	// raft_term is the raft term when the request was applied.
-	RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"`
+	RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,proto3" json:"raft_term,omitempty"`
 }
 }
 
 
 func (m *ResponseHeader) Reset()                    { *m = ResponseHeader{} }
 func (m *ResponseHeader) Reset()                    { *m = ResponseHeader{} }
@@ -201,7 +201,7 @@ type RangeRequest struct {
 	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
 	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
 	// range_end is the upper bound on the requested range [key, range_end).
 	// range_end is the upper bound on the requested range [key, range_end).
 	// If range_end is '\0', the range is all keys >= key.
 	// If range_end is '\0', the range is all keys >= key.
-	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
+	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
 	// limit is a limit on the number of keys returned for the request.
 	// limit is a limit on the number of keys returned for the request.
 	Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
 	Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
 	// revision is the point-in-time of the key-value store to use for the range.
 	// revision is the point-in-time of the key-value store to use for the range.
@@ -209,9 +209,9 @@ type RangeRequest struct {
 	// If the revision has been compacted, ErrCompaction is returned as a response.
 	// If the revision has been compacted, ErrCompaction is returned as a response.
 	Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
 	Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
 	// sort_order is the order for returned sorted results.
 	// sort_order is the order for returned sorted results.
-	SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"`
+	SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"`
 	// sort_target is the key-value field to use for sorting.
 	// sort_target is the key-value field to use for sorting.
-	SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,json=sortTarget,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"`
+	SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"`
 	// serializable sets the range request to use serializable member-local reads.
 	// serializable sets the range request to use serializable member-local reads.
 	// Range requests are linearizable by default; linearizable requests have higher
 	// Range requests are linearizable by default; linearizable requests have higher
 	// latency and lower throughput than serializable requests but reflect the current
 	// latency and lower throughput than serializable requests but reflect the current
@@ -229,7 +229,7 @@ func (*RangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []
 type RangeResponse struct {
 type RangeResponse struct {
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	// kvs is the list of key-value pairs matched by the range request.
 	// kvs is the list of key-value pairs matched by the range request.
-	Kvs []*storagepb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
+	Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
 	// more indicates if there are more keys to return in the requested range.
 	// more indicates if there are more keys to return in the requested range.
 	More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"`
 	More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"`
 }
 }
@@ -246,7 +246,7 @@ func (m *RangeResponse) GetHeader() *ResponseHeader {
 	return nil
 	return nil
 }
 }
 
 
-func (m *RangeResponse) GetKvs() []*storagepb.KeyValue {
+func (m *RangeResponse) GetKvs() []*mvccpb.KeyValue {
 	if m != nil {
 	if m != nil {
 		return m.Kvs
 		return m.Kvs
 	}
 	}
@@ -290,7 +290,7 @@ type DeleteRangeRequest struct {
 	// range_end is the key following the last key to delete for the range [key, range_end).
 	// range_end is the key following the last key to delete for the range [key, range_end).
 	// If range_end is not given, the range is defined to contain only the key argument.
 	// If range_end is not given, the range is defined to contain only the key argument.
 	// If range_end is '\0', the range is all keys greater than or equal to the key argument.
 	// If range_end is '\0', the range is all keys greater than or equal to the key argument.
-	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
+	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
 }
 }
 
 
 func (m *DeleteRangeRequest) Reset()                    { *m = DeleteRangeRequest{} }
 func (m *DeleteRangeRequest) Reset()                    { *m = DeleteRangeRequest{} }
@@ -338,13 +338,13 @@ type isRequestUnion_Request interface {
 }
 }
 
 
 type RequestUnion_RequestRange struct {
 type RequestUnion_RequestRange struct {
-	RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,oneof"`
+	RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,oneof"`
 }
 }
 type RequestUnion_RequestPut struct {
 type RequestUnion_RequestPut struct {
-	RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,oneof"`
+	RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,oneof"`
 }
 }
 type RequestUnion_RequestDeleteRange struct {
 type RequestUnion_RequestDeleteRange struct {
-	RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,oneof"`
+	RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,oneof"`
 }
 }
 
 
 func (*RequestUnion_RequestRange) isRequestUnion_Request()       {}
 func (*RequestUnion_RequestRange) isRequestUnion_Request()       {}
@@ -494,13 +494,13 @@ type isResponseUnion_Response interface {
 }
 }
 
 
 type ResponseUnion_ResponseRange struct {
 type ResponseUnion_ResponseRange struct {
-	ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,oneof"`
+	ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,oneof"`
 }
 }
 type ResponseUnion_ResponsePut struct {
 type ResponseUnion_ResponsePut struct {
-	ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,oneof"`
+	ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,oneof"`
 }
 }
 type ResponseUnion_ResponseDeleteRange struct {
 type ResponseUnion_ResponseDeleteRange struct {
-	ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,oneof"`
+	ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,oneof"`
 }
 }
 
 
 func (*ResponseUnion_ResponseRange) isResponseUnion_Response()       {}
 func (*ResponseUnion_ResponseRange) isResponseUnion_Response()       {}
@@ -658,10 +658,10 @@ type Compare_Version struct {
 	Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"`
 	Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"`
 }
 }
 type Compare_CreateRevision struct {
 type Compare_CreateRevision struct {
-	CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof"`
+	CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3,oneof"`
 }
 }
 type Compare_ModRevision struct {
 type Compare_ModRevision struct {
-	ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof"`
+	ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3,oneof"`
 }
 }
 type Compare_Value struct {
 type Compare_Value struct {
 	Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"`
 	Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"`
@@ -953,7 +953,7 @@ type SnapshotResponse struct {
 	// stream indicates the point in time of the snapshot.
 	// stream indicates the point in time of the snapshot.
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	// remaining_bytes is the number of blob bytes to be sent after this message
 	// remaining_bytes is the number of blob bytes to be sent after this message
-	RemainingBytes uint64 `protobuf:"varint,2,opt,name=remaining_bytes,json=remainingBytes,proto3" json:"remaining_bytes,omitempty"`
+	RemainingBytes uint64 `protobuf:"varint,2,opt,name=remaining_bytes,proto3" json:"remaining_bytes,omitempty"`
 	// blob contains the next chunk of the snapshot in the snapshot stream.
 	// blob contains the next chunk of the snapshot in the snapshot stream.
 	Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"`
 	Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"`
 }
 }
@@ -991,10 +991,10 @@ type isWatchRequest_RequestUnion interface {
 }
 }
 
 
 type WatchRequest_CreateRequest struct {
 type WatchRequest_CreateRequest struct {
-	CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,oneof"`
+	CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,oneof"`
 }
 }
 type WatchRequest_CancelRequest struct {
 type WatchRequest_CancelRequest struct {
-	CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,oneof"`
+	CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,oneof"`
 }
 }
 
 
 func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {}
 func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {}
@@ -1101,14 +1101,14 @@ type WatchCreateRequest struct {
 	// range_end is the end of the range [key, range_end) to watch. If range_end is not given,
 	// range_end is the end of the range [key, range_end) to watch. If range_end is not given,
 	// only the key argument is watched. If range_end is equal to '\0', all keys greater than
 	// only the key argument is watched. If range_end is equal to '\0', all keys greater than
 	// or equal to the key argument are watched.
 	// or equal to the key argument are watched.
-	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
+	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
 	// start_revision is an optional revision to watch from (inclusive). No start_revision is "now".
 	// start_revision is an optional revision to watch from (inclusive). No start_revision is "now".
-	StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,json=startRevision,proto3" json:"start_revision,omitempty"`
+	StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,proto3" json:"start_revision,omitempty"`
 	// progress_notify is set so that the etcd server will periodically send a WatchResponse with
 	// progress_notify is set so that the etcd server will periodically send a WatchResponse with
 	// no events to the new watcher if there are no recent events. It is useful when clients
 	// no events to the new watcher if there are no recent events. It is useful when clients
 	// wish to recover a disconnected watcher starting from a recent known revision.
 	// wish to recover a disconnected watcher starting from a recent known revision.
 	// The etcd server may decide how often it will send notifications based on current load.
 	// The etcd server may decide how often it will send notifications based on current load.
-	ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,json=progressNotify,proto3" json:"progress_notify,omitempty"`
+	ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,proto3" json:"progress_notify,omitempty"`
 }
 }
 
 
 func (m *WatchCreateRequest) Reset()                    { *m = WatchCreateRequest{} }
 func (m *WatchCreateRequest) Reset()                    { *m = WatchCreateRequest{} }
@@ -1118,7 +1118,7 @@ func (*WatchCreateRequest) Descriptor() ([]byte, []int) { return fileDescriptorR
 
 
 type WatchCancelRequest struct {
 type WatchCancelRequest struct {
 	// watch_id is the watcher id to cancel so that no more events are transmitted.
 	// watch_id is the watcher id to cancel so that no more events are transmitted.
-	WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"`
+	WatchId int64 `protobuf:"varint,1,opt,name=watch_id,proto3" json:"watch_id,omitempty"`
 }
 }
 
 
 func (m *WatchCancelRequest) Reset()                    { *m = WatchCancelRequest{} }
 func (m *WatchCancelRequest) Reset()                    { *m = WatchCancelRequest{} }
@@ -1129,7 +1129,7 @@ func (*WatchCancelRequest) Descriptor() ([]byte, []int) { return fileDescriptorR
 type WatchResponse struct {
 type WatchResponse struct {
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	// watch_id is the ID of the watcher that corresponds to the response.
 	// watch_id is the ID of the watcher that corresponds to the response.
-	WatchId int64 `protobuf:"varint,2,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"`
+	WatchId int64 `protobuf:"varint,2,opt,name=watch_id,proto3" json:"watch_id,omitempty"`
 	// created is set to true if the response is for a create watch request.
 	// created is set to true if the response is for a create watch request.
 	// The client should record the watch_id and expect to receive events for
 	// The client should record the watch_id and expect to receive events for
 	// the created watcher from the same stream.
 	// the created watcher from the same stream.
@@ -1146,8 +1146,8 @@ type WatchResponse struct {
 	//
 	//
 	// The client should treat the watcher as canceled and should not try to create any
 	// The client should treat the watcher as canceled and should not try to create any
 	// watcher with the same start_revision again.
 	// watcher with the same start_revision again.
-	CompactRevision int64              `protobuf:"varint,5,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"`
-	Events          []*storagepb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"`
+	CompactRevision int64           `protobuf:"varint,5,opt,name=compact_revision,proto3" json:"compact_revision,omitempty"`
+	Events          []*mvccpb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"`
 }
 }
 
 
 func (m *WatchResponse) Reset()                    { *m = WatchResponse{} }
 func (m *WatchResponse) Reset()                    { *m = WatchResponse{} }
@@ -1162,7 +1162,7 @@ func (m *WatchResponse) GetHeader() *ResponseHeader {
 	return nil
 	return nil
 }
 }
 
 
-func (m *WatchResponse) GetEvents() []*storagepb.Event {
+func (m *WatchResponse) GetEvents() []*mvccpb.Event {
 	if m != nil {
 	if m != nil {
 		return m.Events
 		return m.Events
 	}
 	}
@@ -1171,9 +1171,9 @@ func (m *WatchResponse) GetEvents() []*storagepb.Event {
 
 
 type LeaseGrantRequest struct {
 type LeaseGrantRequest struct {
 	// TTL is the advisory time-to-live in seconds.
 	// TTL is the advisory time-to-live in seconds.
-	TTL int64 `protobuf:"varint,1,opt,name=TTL,json=tTL,proto3" json:"TTL,omitempty"`
+	TTL int64 `protobuf:"varint,1,opt,name=TTL,proto3" json:"TTL,omitempty"`
 	// ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID.
 	// ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID.
-	ID int64 `protobuf:"varint,2,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"`
 }
 }
 
 
 func (m *LeaseGrantRequest) Reset()                    { *m = LeaseGrantRequest{} }
 func (m *LeaseGrantRequest) Reset()                    { *m = LeaseGrantRequest{} }
@@ -1184,9 +1184,9 @@ func (*LeaseGrantRequest) Descriptor() ([]byte, []int) { return fileDescriptorRp
 type LeaseGrantResponse struct {
 type LeaseGrantResponse struct {
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	// ID is the lease ID for the granted lease.
 	// ID is the lease ID for the granted lease.
-	ID int64 `protobuf:"varint,2,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"`
 	// TTL is the server chosen lease time-to-live in seconds.
 	// TTL is the server chosen lease time-to-live in seconds.
-	TTL   int64  `protobuf:"varint,3,opt,name=TTL,json=tTL,proto3" json:"TTL,omitempty"`
+	TTL   int64  `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"`
 	Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
 	Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
 }
 }
 
 
@@ -1204,7 +1204,7 @@ func (m *LeaseGrantResponse) GetHeader() *ResponseHeader {
 
 
 type LeaseRevokeRequest struct {
 type LeaseRevokeRequest struct {
 	// ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted.
 	// ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted.
-	ID int64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
 }
 }
 
 
 func (m *LeaseRevokeRequest) Reset()                    { *m = LeaseRevokeRequest{} }
 func (m *LeaseRevokeRequest) Reset()                    { *m = LeaseRevokeRequest{} }
@@ -1230,7 +1230,7 @@ func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader {
 
 
 type LeaseKeepAliveRequest struct {
 type LeaseKeepAliveRequest struct {
 	// ID is the lease ID for the lease to keep alive.
 	// ID is the lease ID for the lease to keep alive.
-	ID int64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
 }
 }
 
 
 func (m *LeaseKeepAliveRequest) Reset()                    { *m = LeaseKeepAliveRequest{} }
 func (m *LeaseKeepAliveRequest) Reset()                    { *m = LeaseKeepAliveRequest{} }
@@ -1241,9 +1241,9 @@ func (*LeaseKeepAliveRequest) Descriptor() ([]byte, []int) { return fileDescript
 type LeaseKeepAliveResponse struct {
 type LeaseKeepAliveResponse struct {
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
 	// ID is the lease ID from the keep alive request.
 	// ID is the lease ID from the keep alive request.
-	ID int64 `protobuf:"varint,2,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"`
 	// TTL is the new time-to-live for the lease.
 	// TTL is the new time-to-live for the lease.
-	TTL int64 `protobuf:"varint,3,opt,name=TTL,json=tTL,proto3" json:"TTL,omitempty"`
+	TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"`
 }
 }
 
 
 func (m *LeaseKeepAliveResponse) Reset()                    { *m = LeaseKeepAliveResponse{} }
 func (m *LeaseKeepAliveResponse) Reset()                    { *m = LeaseKeepAliveResponse{} }
@@ -1260,7 +1260,7 @@ func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader {
 
 
 type Member struct {
 type Member struct {
 	// ID is the member ID for this member.
 	// ID is the member ID for this member.
-	ID uint64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
 	// name is the human-readable name of the member. If the member is not started, the name will be an empty string.
 	// name is the human-readable name of the member. If the member is not started, the name will be an empty string.
 	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
 	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
 	// peerURLs is the list of URLs the member exposes to the cluster for communication.
 	// peerURLs is the list of URLs the member exposes to the cluster for communication.
@@ -1311,7 +1311,7 @@ func (m *MemberAddResponse) GetMember() *Member {
 
 
 type MemberRemoveRequest struct {
 type MemberRemoveRequest struct {
 	// ID is the member ID of the member to remove.
 	// ID is the member ID of the member to remove.
-	ID uint64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
 }
 }
 
 
 func (m *MemberRemoveRequest) Reset()                    { *m = MemberRemoveRequest{} }
 func (m *MemberRemoveRequest) Reset()                    { *m = MemberRemoveRequest{} }
@@ -1337,7 +1337,7 @@ func (m *MemberRemoveResponse) GetHeader() *ResponseHeader {
 
 
 type MemberUpdateRequest struct {
 type MemberUpdateRequest struct {
 	// ID is the member ID of the member to update.
 	// ID is the member ID of the member to update.
-	ID uint64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
+	ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
 	// peerURLs is the new list of URLs the member will use to communicate with the cluster.
 	// peerURLs is the new list of URLs the member will use to communicate with the cluster.
 	PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs" json:"peerURLs,omitempty"`
 	PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs" json:"peerURLs,omitempty"`
 }
 }
@@ -7224,7 +7224,7 @@ func (m *RangeResponse) Unmarshal(data []byte) error {
 			if postIndex > l {
 			if postIndex > l {
 				return io.ErrUnexpectedEOF
 				return io.ErrUnexpectedEOF
 			}
 			}
-			m.Kvs = append(m.Kvs, &storagepb.KeyValue{})
+			m.Kvs = append(m.Kvs, &mvccpb.KeyValue{})
 			if err := m.Kvs[len(m.Kvs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
 			if err := m.Kvs[len(m.Kvs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
 				return err
 				return err
 			}
 			}
@@ -9483,7 +9483,7 @@ func (m *WatchResponse) Unmarshal(data []byte) error {
 			if postIndex > l {
 			if postIndex > l {
 				return io.ErrUnexpectedEOF
 				return io.ErrUnexpectedEOF
 			}
 			}
-			m.Events = append(m.Events, &storagepb.Event{})
+			m.Events = append(m.Events, &mvccpb.Event{})
 			if err := m.Events[len(m.Events)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
 			if err := m.Events[len(m.Events)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
 				return err
 				return err
 			}
 			}
@@ -13966,167 +13966,152 @@ var (
 )
 )
 
 
 var fileDescriptorRpc = []byte{
 var fileDescriptorRpc = []byte{
-	// 2577 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x5a, 0xcd, 0x72, 0x1b, 0xc7,
-	0x11, 0x26, 0x7e, 0x08, 0x10, 0x0d, 0x10, 0xa2, 0x86, 0x94, 0x4c, 0x43, 0xb6, 0x24, 0xaf, 0x24,
-	0x5b, 0x89, 0x1d, 0x2a, 0x66, 0x9c, 0x43, 0x2a, 0x2e, 0xa5, 0x40, 0x02, 0x96, 0x68, 0x52, 0xa4,
-	0xbc, 0x04, 0xa9, 0xf8, 0xc4, 0x5a, 0x02, 0x23, 0x12, 0x25, 0xfc, 0x79, 0x77, 0x41, 0x89, 0x3a,
-	0xa5, 0x52, 0x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0xb8, 0xf8, 0xc4, 0x9b,
+	0x9d, 0x79, 0x98, 0x44, 0xd6, 0xdf, 0x02, 0x99, 0x1e, 0x0e, 0xc9, 0xc7, 0x66, 0x6a, 0xe3, 0xd2,
+	0x54, 0x7d, 0xfa, 0x7e, 0xc8, 0x81, 0xc8, 0x13, 0x28, 0x04, 0xf3, 0x23, 0xb1, 0x66, 0xd8, 0xaf,
+	0xdf, 0x34, 0xeb, 0x57, 0xe2, 0xc4, 0xbd, 0x24, 0xef, 0x9a, 0x19, 0x44, 0xd1, 0xeb, 0x66, 0xe3,
+	0x6a, 0x24, 0x3d, 0xa4, 0x72, 0xc6, 0x34, 0x85, 0x34, 0xba, 0xc1, 0x99, 0x42, 0x1a, 0x1b, 0x50,
+	0x43, 0x8e, 0x33, 0x92, 0x24, 0xba, 0xef, 0xcd, 0xe2, 0x38, 0x95, 0x24, 0xe1, 0xf4, 0x69, 0x32,
+	0x7f, 0x6a, 0x5d, 0x34, 0x99, 0x3f, 0x3d, 0xc0, 0x8a, 0x88, 0x05, 0x03, 0xa9, 0x29, 0x62, 0xf1,
+	0x7d, 0xb3, 0xba, 0x7e, 0x25, 0x4e, 0x5c, 0xe5, 0xd9, 0x11, 0x9b, 0x5a, 0x40, 0x67, 0xa9, 0x1c,
+	0x8f, 0xd8, 0x56, 0xe9, 0x8f, 0xff, 0x7c, 0x98, 0xfa, 0x0b, 0xfe, 0xfb, 0x07, 0xfe, 0x3b, 0xcd,
+	0xf1, 0xff, 0x95, 0xe2, 0xf9, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x6e, 0x06, 0x62, 0xb3,
+	0x21, 0x00, 0x00,
 }
 }

+ 3 - 3
etcdserver/etcdserverpb/rpc.proto

@@ -2,7 +2,7 @@ syntax = "proto3";
 package etcdserverpb;
 package etcdserverpb;
 
 
 import "gogoproto/gogo.proto";
 import "gogoproto/gogo.proto";
-import "etcd/storage/storagepb/kv.proto";
+import "etcd/mvcc/mvccpb/kv.proto";
 import "etcd/auth/authpb/auth.proto";
 import "etcd/auth/authpb/auth.proto";
 
 
 option (gogoproto.marshaler_all) = true;
 option (gogoproto.marshaler_all) = true;
@@ -192,7 +192,7 @@ message RangeRequest {
 message RangeResponse {
 message RangeResponse {
   ResponseHeader header = 1;
   ResponseHeader header = 1;
   // kvs is the list of key-value pairs matched by the range request.
   // kvs is the list of key-value pairs matched by the range request.
-  repeated storagepb.KeyValue kvs = 2;
+  repeated mvccpb.KeyValue kvs = 2;
   // more indicates if there are more keys to return in the requested range.
   // more indicates if there are more keys to return in the requested range.
   bool more = 3;
   bool more = 3;
 }
 }
@@ -401,7 +401,7 @@ message WatchResponse {
   // watcher with the same start_revision again.
   // watcher with the same start_revision again.
   int64 compact_revision  = 5;
   int64 compact_revision  = 5;
 
 
-  repeated storagepb.Event events = 11;
+  repeated mvccpb.Event events = 11;
 }
 }
 
 
 message LeaseGrantRequest {
 message LeaseGrantRequest {

+ 1 - 1
etcdserver/membership/cluster.go

@@ -25,11 +25,11 @@ import (
 	"strings"
 	"strings"
 	"sync"
 	"sync"
 
 
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/netutil"
 	"github.com/coreos/etcd/pkg/netutil"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/raft"
 	"github.com/coreos/etcd/raft"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/raft/raftpb"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/etcd/store"
 	"github.com/coreos/etcd/store"
 	"github.com/coreos/etcd/version"
 	"github.com/coreos/etcd/version"
 	"github.com/coreos/go-semver/semver"
 	"github.com/coreos/go-semver/semver"

+ 1 - 1
etcdserver/membership/store.go

@@ -19,8 +19,8 @@ import (
 	"fmt"
 	"fmt"
 	"path"
 	"path"
 
 
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/types"
 	"github.com/coreos/etcd/pkg/types"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/etcd/store"
 	"github.com/coreos/etcd/store"
 
 
 	"github.com/coreos/go-semver/semver"
 	"github.com/coreos/go-semver/semver"

+ 1 - 1
etcdserver/quota.go

@@ -16,7 +16,7 @@ package etcdserver
 
 
 import (
 import (
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 // Quota represents an arbitrary quota against arbitrary requests. Each request
 // Quota represents an arbitrary quota against arbitrary requests. Each request

+ 5 - 5
etcdserver/server.go

@@ -36,6 +36,8 @@ import (
 	"github.com/coreos/etcd/etcdserver/membership"
 	"github.com/coreos/etcd/etcdserver/membership"
 	"github.com/coreos/etcd/etcdserver/stats"
 	"github.com/coreos/etcd/etcdserver/stats"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
+	"github.com/coreos/etcd/mvcc"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/fileutil"
 	"github.com/coreos/etcd/pkg/fileutil"
 	"github.com/coreos/etcd/pkg/idutil"
 	"github.com/coreos/etcd/pkg/idutil"
 	"github.com/coreos/etcd/pkg/pbutil"
 	"github.com/coreos/etcd/pkg/pbutil"
@@ -47,8 +49,6 @@ import (
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/rafthttp"
 	"github.com/coreos/etcd/rafthttp"
 	"github.com/coreos/etcd/snap"
 	"github.com/coreos/etcd/snap"
-	dstorage "github.com/coreos/etcd/storage"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/etcd/store"
 	"github.com/coreos/etcd/store"
 	"github.com/coreos/etcd/version"
 	"github.com/coreos/etcd/version"
 	"github.com/coreos/etcd/wal"
 	"github.com/coreos/etcd/wal"
@@ -181,7 +181,7 @@ type EtcdServer struct {
 	applyV2 applierV2
 	applyV2 applierV2
 
 
 	applyV3    applierV3
 	applyV3    applierV3
-	kv         dstorage.ConsistentWatchableKV
+	kv         mvcc.ConsistentWatchableKV
 	lessor     lease.Lessor
 	lessor     lease.Lessor
 	bemu       sync.Mutex
 	bemu       sync.Mutex
 	be         backend.Backend
 	be         backend.Backend
@@ -392,7 +392,7 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) {
 
 
 	srv.be = be
 	srv.be = be
 	srv.lessor = lease.NewLessor(srv.be)
 	srv.lessor = lease.NewLessor(srv.be)
-	srv.kv = dstorage.New(srv.be, srv.lessor, &srv.consistIndex)
+	srv.kv = mvcc.New(srv.be, srv.lessor, &srv.consistIndex)
 	srv.consistIndex.setConsistentIndex(srv.kv.ConsistentIndex())
 	srv.consistIndex.setConsistentIndex(srv.kv.ConsistentIndex())
 	srv.authStore = auth.NewAuthStore(srv.be)
 	srv.authStore = auth.NewAuthStore(srv.be)
 	if h := cfg.AutoCompactionRetention; h != 0 {
 	if h := cfg.AutoCompactionRetention; h != 0 {
@@ -1258,7 +1258,7 @@ func (s *EtcdServer) parseProposeCtxErr(err error, start time.Time) error {
 	}
 	}
 }
 }
 
 
-func (s *EtcdServer) KV() dstorage.ConsistentWatchableKV { return s.kv }
+func (s *EtcdServer) KV() mvcc.ConsistentWatchableKV { return s.kv }
 func (s *EtcdServer) Backend() backend.Backend {
 func (s *EtcdServer) Backend() backend.Backend {
 	s.bemu.Lock()
 	s.bemu.Lock()
 	defer s.bemu.Unlock()
 	defer s.bemu.Unlock()

+ 5 - 5
etcdserver/server_test.go

@@ -27,6 +27,8 @@ import (
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/etcdserver/membership"
 	"github.com/coreos/etcd/etcdserver/membership"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
+	"github.com/coreos/etcd/mvcc"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/pkg/idutil"
 	"github.com/coreos/etcd/pkg/idutil"
 	"github.com/coreos/etcd/pkg/mock/mockstorage"
 	"github.com/coreos/etcd/pkg/mock/mockstorage"
 	"github.com/coreos/etcd/pkg/mock/mockstore"
 	"github.com/coreos/etcd/pkg/mock/mockstore"
@@ -38,8 +40,6 @@ import (
 	"github.com/coreos/etcd/raft"
 	"github.com/coreos/etcd/raft"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/rafthttp"
 	"github.com/coreos/etcd/rafthttp"
-	dstorage "github.com/coreos/etcd/storage"
-	"github.com/coreos/etcd/storage/backend"
 	"github.com/coreos/etcd/store"
 	"github.com/coreos/etcd/store"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
@@ -855,7 +855,7 @@ func TestSnapshot(t *testing.T) {
 		},
 		},
 		store: st,
 		store: st,
 	}
 	}
-	srv.kv = dstorage.New(be, &lease.FakeLessor{}, &srv.consistIndex)
+	srv.kv = mvcc.New(be, &lease.FakeLessor{}, &srv.consistIndex)
 	srv.be = be
 	srv.be = be
 
 
 	srv.snapshot(1, raftpb.ConfState{Nodes: []uint64{1}})
 	srv.snapshot(1, raftpb.ConfState{Nodes: []uint64{1}})
@@ -902,7 +902,7 @@ func TestTriggerSnap(t *testing.T) {
 	}
 	}
 	srv.applyV2 = &applierV2store{srv}
 	srv.applyV2 = &applierV2store{srv}
 
 
-	srv.kv = dstorage.New(be, &lease.FakeLessor{}, &srv.consistIndex)
+	srv.kv = mvcc.New(be, &lease.FakeLessor{}, &srv.consistIndex)
 	srv.be = be
 	srv.be = be
 
 
 	srv.start()
 	srv.start()
@@ -974,7 +974,7 @@ func TestConcurrentApplyAndSnapshotV3(t *testing.T) {
 	defer func() {
 	defer func() {
 		os.RemoveAll(tmpPath)
 		os.RemoveAll(tmpPath)
 	}()
 	}()
-	s.kv = dstorage.New(be, &lease.FakeLessor{}, &s.consistIndex)
+	s.kv = mvcc.New(be, &lease.FakeLessor{}, &s.consistIndex)
 	s.be = be
 	s.be = be
 
 
 	s.start()
 	s.start()

+ 1 - 1
etcdserver/snapshot_merge.go

@@ -18,9 +18,9 @@ import (
 	"io"
 	"io"
 	"log"
 	"log"
 
 
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/raft/raftpb"
 	"github.com/coreos/etcd/snap"
 	"github.com/coreos/etcd/snap"
-	"github.com/coreos/etcd/storage/backend"
 )
 )
 
 
 // createMergedSnapshotMessage creates a snapshot message that contains: raft status (term, conf),
 // createMergedSnapshotMessage creates a snapshot message that contains: raft status (term, conf),

+ 2 - 2
etcdserver/v3_server.go

@@ -20,7 +20,7 @@ import (
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease/leasehttp"
 	"github.com/coreos/etcd/lease/leasehttp"
-	dstorage "github.com/coreos/etcd/storage"
+	"github.com/coreos/etcd/mvcc"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -297,4 +297,4 @@ func (s *EtcdServer) processInternalRaftRequest(ctx context.Context, r pb.Intern
 }
 }
 
 
 // Watchable returns a watchable interface attached to the etcdserver.
 // Watchable returns a watchable interface attached to the etcdserver.
-func (s *EtcdServer) Watchable() dstorage.Watchable { return s.KV() }
+func (s *EtcdServer) Watchable() mvcc.Watchable { return s.KV() }

+ 2 - 2
integration/v3_lease_test.go

@@ -21,8 +21,8 @@ import (
 
 
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	"github.com/coreos/etcd/storage/storagepb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -158,7 +158,7 @@ func TestV3LeaseExpire(t *testing.T) {
 				errc <- err
 				errc <- err
 			case len(resp.Events) != 1:
 			case len(resp.Events) != 1:
 				fallthrough
 				fallthrough
-			case resp.Events[0].Type != storagepb.DELETE:
+			case resp.Events[0].Type != mvccpb.DELETE:
 				errc <- fmt.Errorf("expected key delete, got %v", resp)
 				errc <- fmt.Errorf("expected key delete, got %v", resp)
 			default:
 			default:
 				errc <- nil
 				errc <- nil

+ 53 - 53
integration/v3_watch_test.go

@@ -25,8 +25,8 @@ import (
 
 
 	"github.com/coreos/etcd/etcdserver/api/v3rpc"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
 	pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	"github.com/coreos/etcd/storage/storagepb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -50,10 +50,10 @@ func TestV3WatchFromCurrentRevision(t *testing.T) {
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 						},
 						},
 					},
 					},
 				},
 				},
@@ -80,10 +80,10 @@ func TestV3WatchFromCurrentRevision(t *testing.T) {
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 						},
 						},
 					},
 					},
 				},
 				},
@@ -111,10 +111,10 @@ func TestV3WatchFromCurrentRevision(t *testing.T) {
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 						},
 						},
 					},
 					},
 				},
 				},
@@ -131,30 +131,30 @@ func TestV3WatchFromCurrentRevision(t *testing.T) {
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 						},
 						},
 					},
 					},
 				},
 				},
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 3},
 					Header:  &pb.ResponseHeader{Revision: 3},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2},
 						},
 						},
 					},
 					},
 				},
 				},
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 4},
 					Header:  &pb.ResponseHeader{Revision: 4},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 3},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 3},
 						},
 						},
 					},
 					},
 				},
 				},
@@ -172,30 +172,30 @@ func TestV3WatchFromCurrentRevision(t *testing.T) {
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Header:  &pb.ResponseHeader{Revision: 2},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 						},
 						},
 					},
 					},
 				},
 				},
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 3},
 					Header:  &pb.ResponseHeader{Revision: 3},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 3, Version: 2},
 						},
 						},
 					},
 					},
 				},
 				},
 				{
 				{
 					Header:  &pb.ResponseHeader{Revision: 4},
 					Header:  &pb.ResponseHeader{Revision: 4},
 					Created: false,
 					Created: false,
-					Events: []*storagepb.Event{
+					Events: []*mvccpb.Event{
 						{
 						{
-							Type: storagepb.PUT,
-							Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 3},
+							Type: mvccpb.PUT,
+							Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 3},
 						},
 						},
 					},
 					},
 				},
 				},
@@ -527,10 +527,10 @@ func TestV3WatchEmptyKey(t *testing.T) {
 	if rerr != nil {
 	if rerr != nil {
 		t.Fatal(rerr)
 		t.Fatal(rerr)
 	}
 	}
-	wevs := []*storagepb.Event{
+	wevs := []*mvccpb.Event{
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo"), CreateRevision: 2, ModRevision: 2, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo"), CreateRevision: 2, ModRevision: 2, Version: 1},
 		},
 		},
 	}
 	}
 	if !reflect.DeepEqual(resp.Events, wevs) {
 	if !reflect.DeepEqual(resp.Events, wevs) {
@@ -691,7 +691,7 @@ func testV3WatchMultipleEventsTxn(t *testing.T, startRev int64) {
 		t.Fatalf("kvc.Txn failed: %+v", tresp)
 		t.Fatalf("kvc.Txn failed: %+v", tresp)
 	}
 	}
 
 
-	events := []*storagepb.Event{}
+	events := []*mvccpb.Event{}
 	for len(events) < 3 {
 	for len(events) < 3 {
 		resp, err := wStream.Recv()
 		resp, err := wStream.Recv()
 		if err != nil {
 		if err != nil {
@@ -704,18 +704,18 @@ func testV3WatchMultipleEventsTxn(t *testing.T, startRev int64) {
 	}
 	}
 	sort.Sort(eventsSortByKey(events))
 	sort.Sort(eventsSortByKey(events))
 
 
-	wevents := []*storagepb.Event{
+	wevents := []*mvccpb.Event{
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo0"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo0"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo2"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo2"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 		},
 		},
 	}
 	}
 
 
@@ -732,7 +732,7 @@ func testV3WatchMultipleEventsTxn(t *testing.T, startRev int64) {
 	clus.Terminate(t)
 	clus.Terminate(t)
 }
 }
 
 
-type eventsSortByKey []*storagepb.Event
+type eventsSortByKey []*mvccpb.Event
 
 
 func (evs eventsSortByKey) Len() int           { return len(evs) }
 func (evs eventsSortByKey) Len() int           { return len(evs) }
 func (evs eventsSortByKey) Swap(i, j int)      { evs[i], evs[j] = evs[j], evs[i] }
 func (evs eventsSortByKey) Swap(i, j int)      { evs[i], evs[j] = evs[j], evs[i] }
@@ -773,26 +773,26 @@ func TestV3WatchMultipleEventsPutUnsynced(t *testing.T) {
 		t.Fatalf("couldn't put key (%v)", err)
 		t.Fatalf("couldn't put key (%v)", err)
 	}
 	}
 
 
-	allWevents := []*storagepb.Event{
+	allWevents := []*mvccpb.Event{
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo0"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo0"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 3, ModRevision: 3, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 3, ModRevision: 3, Version: 1},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo0"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 2},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo0"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 4, Version: 2},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 3, ModRevision: 5, Version: 2},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo1"), Value: []byte("bar"), CreateRevision: 3, ModRevision: 5, Version: 2},
 		},
 		},
 	}
 	}
 
 
-	events := []*storagepb.Event{}
+	events := []*mvccpb.Event{}
 	for len(events) < 4 {
 	for len(events) < 4 {
 		resp, err := wStream.Recv()
 		resp, err := wStream.Recv()
 		if err != nil {
 		if err != nil {
@@ -866,10 +866,10 @@ func testV3WatchMultipleStreams(t *testing.T, startRev int64) {
 
 
 	var wg sync.WaitGroup
 	var wg sync.WaitGroup
 	wg.Add(len(streams))
 	wg.Add(len(streams))
-	wevents := []*storagepb.Event{
+	wevents := []*mvccpb.Event{
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
 		},
 		},
 	}
 	}
 	for i := range streams {
 	for i := range streams {

+ 8 - 9
lease/leasepb/lease.pb.go

@@ -33,8 +33,8 @@ var _ = math.Inf
 const _ = proto.GoGoProtoPackageIsVersion1
 const _ = proto.GoGoProtoPackageIsVersion1
 
 
 type Lease struct {
 type Lease struct {
-	ID  int64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
-	TTL int64 `protobuf:"varint,2,opt,name=TTL,json=tTL,proto3" json:"TTL,omitempty"`
+	ID  int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
+	TTL int64 `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"`
 }
 }
 
 
 func (m *Lease) Reset()                    { *m = Lease{} }
 func (m *Lease) Reset()                    { *m = Lease{} }
@@ -319,13 +319,12 @@ var (
 )
 )
 
 
 var fileDescriptorLease = []byte{
 var fileDescriptorLease = []byte{
-	// 117 bytes of a gzipped FileDescriptorProto
+	// 108 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2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02, 0x10,
+	0x9f, 0x78, 0x24, 0xc7, 0x78, 0x01, 0x88, 0x1f, 0x00, 0x71, 0x12, 0x1b, 0x58, 0xbb, 0x31, 0x20,
+	0x00, 0x00, 0xff, 0xff, 0x87, 0x43, 0xe8, 0x0c, 0x6c, 0x00, 0x00, 0x00,
 }
 }

+ 2 - 2
lease/lessor.go

@@ -22,7 +22,7 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease/leasepb"
 	"github.com/coreos/etcd/lease/leasepb"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 const (
 const (
@@ -47,7 +47,7 @@ type LeaseID int64
 
 
 // RangeDeleter defines an interface with DeleteRange method.
 // RangeDeleter defines an interface with DeleteRange method.
 // We define this interface only for lessor to limit the number
 // We define this interface only for lessor to limit the number
-// of methods of storage.KV to what lessor actually needs.
+// of methods of mvcc.KV to what lessor actually needs.
 //
 //
 // Having a minimum interface makes testing easy.
 // Having a minimum interface makes testing easy.
 type RangeDeleter interface {
 type RangeDeleter interface {

+ 1 - 1
lease/lessor_test.go

@@ -22,7 +22,7 @@ import (
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 // TestLessorGrant ensures Lessor can grant wanted lease.
 // TestLessorGrant ensures Lessor can grant wanted lease.

+ 0 - 0
storage/backend/backend.go → mvcc/backend/backend.go


+ 0 - 0
storage/backend/backend_bench_test.go → mvcc/backend/backend_bench_test.go


+ 0 - 0
storage/backend/backend_test.go → mvcc/backend/backend_test.go


+ 8 - 8
storage/backend/batch_tx.go → mvcc/backend/batch_tx.go

@@ -52,7 +52,7 @@ func newBatchTx(backend *backend) *batchTx {
 func (t *batchTx) UnsafeCreateBucket(name []byte) {
 func (t *batchTx) UnsafeCreateBucket(name []byte) {
 	_, err := t.tx.CreateBucket(name)
 	_, err := t.tx.CreateBucket(name)
 	if err != nil && err != bolt.ErrBucketExists {
 	if err != nil && err != bolt.ErrBucketExists {
-		log.Fatalf("storage: cannot create bucket %s (%v)", string(name), err)
+		log.Fatalf("mvcc: cannot create bucket %s (%v)", string(name), err)
 	}
 	}
 	t.pending++
 	t.pending++
 }
 }
@@ -70,7 +70,7 @@ func (t *batchTx) UnsafeSeqPut(bucketName []byte, key []byte, value []byte) {
 func (t *batchTx) unsafePut(bucketName []byte, key []byte, value []byte, seq bool) {
 func (t *batchTx) unsafePut(bucketName []byte, key []byte, value []byte, seq bool) {
 	bucket := t.tx.Bucket(bucketName)
 	bucket := t.tx.Bucket(bucketName)
 	if bucket == nil {
 	if bucket == nil {
-		log.Fatalf("storage: bucket %s does not exist", string(bucketName))
+		log.Fatalf("mvcc: bucket %s does not exist", string(bucketName))
 	}
 	}
 	if seq {
 	if seq {
 		// it is useful to increase fill percent when the workloads are mostly append-only.
 		// it is useful to increase fill percent when the workloads are mostly append-only.
@@ -78,7 +78,7 @@ func (t *batchTx) unsafePut(bucketName []byte, key []byte, value []byte, seq boo
 		bucket.FillPercent = 0.9
 		bucket.FillPercent = 0.9
 	}
 	}
 	if err := bucket.Put(key, value); err != nil {
 	if err := bucket.Put(key, value); err != nil {
-		log.Fatalf("storage: cannot put key into bucket (%v)", err)
+		log.Fatalf("mvcc: cannot put key into bucket (%v)", err)
 	}
 	}
 	t.pending++
 	t.pending++
 }
 }
@@ -87,7 +87,7 @@ func (t *batchTx) unsafePut(bucketName []byte, key []byte, value []byte, seq boo
 func (t *batchTx) UnsafeRange(bucketName []byte, key, endKey []byte, limit int64) (keys [][]byte, vs [][]byte) {
 func (t *batchTx) UnsafeRange(bucketName []byte, key, endKey []byte, limit int64) (keys [][]byte, vs [][]byte) {
 	bucket := t.tx.Bucket(bucketName)
 	bucket := t.tx.Bucket(bucketName)
 	if bucket == nil {
 	if bucket == nil {
-		log.Fatalf("storage: bucket %s does not exist", string(bucketName))
+		log.Fatalf("mvcc: bucket %s does not exist", string(bucketName))
 	}
 	}
 
 
 	if len(endKey) == 0 {
 	if len(endKey) == 0 {
@@ -114,11 +114,11 @@ func (t *batchTx) UnsafeRange(bucketName []byte, key, endKey []byte, limit int64
 func (t *batchTx) UnsafeDelete(bucketName []byte, key []byte) {
 func (t *batchTx) UnsafeDelete(bucketName []byte, key []byte) {
 	bucket := t.tx.Bucket(bucketName)
 	bucket := t.tx.Bucket(bucketName)
 	if bucket == nil {
 	if bucket == nil {
-		log.Fatalf("storage: bucket %s does not exist", string(bucketName))
+		log.Fatalf("mvcc: bucket %s does not exist", string(bucketName))
 	}
 	}
 	err := bucket.Delete(key)
 	err := bucket.Delete(key)
 	if err != nil {
 	if err != nil {
-		log.Fatalf("storage: cannot delete key from bucket (%v)", err)
+		log.Fatalf("mvcc: cannot delete key from bucket (%v)", err)
 	}
 	}
 	t.pending++
 	t.pending++
 }
 }
@@ -170,7 +170,7 @@ func (t *batchTx) commit(stop bool) {
 
 
 		t.pending = 0
 		t.pending = 0
 		if err != nil {
 		if err != nil {
-			log.Fatalf("storage: cannot commit tx (%s)", err)
+			log.Fatalf("mvcc: cannot commit tx (%s)", err)
 		}
 		}
 	}
 	}
 
 
@@ -183,7 +183,7 @@ func (t *batchTx) commit(stop bool) {
 	// begin a new tx
 	// begin a new tx
 	t.tx, err = t.backend.db.Begin(true)
 	t.tx, err = t.backend.db.Begin(true)
 	if err != nil {
 	if err != nil {
-		log.Fatalf("storage: cannot begin tx (%s)", err)
+		log.Fatalf("mvcc: cannot begin tx (%s)", err)
 	}
 	}
 	atomic.StoreInt64(&t.backend.size, t.tx.Size())
 	atomic.StoreInt64(&t.backend.size, t.tx.Size())
 }
 }

+ 0 - 0
storage/backend/batch_tx_test.go → mvcc/backend/batch_tx_test.go


+ 0 - 0
storage/backend/boltoption_darwin.go → mvcc/backend/boltoption_darwin.go


+ 0 - 0
storage/backend/boltoption_freebsd.go → mvcc/backend/boltoption_freebsd.go


+ 0 - 0
storage/backend/boltoption_solaris.go → mvcc/backend/boltoption_solaris.go


+ 0 - 0
storage/backend/boltoption_unix.go → mvcc/backend/boltoption_unix.go


+ 0 - 0
storage/backend/boltoption_windows.go → mvcc/backend/boltoption_windows.go


+ 1 - 1
storage/backend/doc.go → mvcc/backend/doc.go

@@ -12,5 +12,5 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-// Package backend defines a standard interface for etcd's backend storage.
+// Package backend defines a standard interface for etcd's backend MVCC storage.
 package backend
 package backend

+ 2 - 2
storage/doc.go → mvcc/doc.go

@@ -12,5 +12,5 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-// Package storage defines etcd's stable storage.
-package storage
+// Package mvcc defines etcd's stable MVCC storage.
+package mvcc

+ 1 - 1
storage/index.go → mvcc/index.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"log"
 	"log"

+ 1 - 1
storage/index_test.go → mvcc/index_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"reflect"
 	"reflect"

+ 1 - 1
storage/key_index.go → mvcc/key_index.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"bytes"
 	"bytes"

+ 1 - 1
storage/key_index_test.go → mvcc/key_index_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"reflect"
 	"reflect"

+ 5 - 5
storage/kv.go → mvcc/kv.go

@@ -12,12 +12,12 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/backend"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 )
 )
 
 
 type KV interface {
 type KV interface {
@@ -37,7 +37,7 @@ type KV interface {
 	// If `end` is not nil and empty, it gets the keys greater than or equal to key.
 	// If `end` is not nil and empty, it gets the keys greater than or equal to key.
 	// Limit limits the number of keys returned.
 	// Limit limits the number of keys returned.
 	// If the required rev is compacted, ErrCompacted will be returned.
 	// If the required rev is compacted, ErrCompacted will be returned.
-	Range(key, end []byte, limit, rangeRev int64) (kvs []storagepb.KeyValue, rev int64, err error)
+	Range(key, end []byte, limit, rangeRev int64) (kvs []mvccpb.KeyValue, rev int64, err error)
 
 
 	// Put puts the given key, value into the store. Put also takes additional argument lease to
 	// Put puts the given key, value into the store. Put also takes additional argument lease to
 	// attach a lease to a key-value pair as meta-data. KV implementation does not validate the lease
 	// attach a lease to a key-value pair as meta-data. KV implementation does not validate the lease
@@ -63,7 +63,7 @@ type KV interface {
 	// TxnEnd ends the on-going txn with txn ID. If the on-going txn ID is not matched, error is returned.
 	// TxnEnd ends the on-going txn with txn ID. If the on-going txn ID is not matched, error is returned.
 	TxnEnd(txnID int64) error
 	TxnEnd(txnID int64) error
 	// TxnRange returns the current revision of the KV when the operation is executed.
 	// TxnRange returns the current revision of the KV when the operation is executed.
-	TxnRange(txnID int64, key, end []byte, limit, rangeRev int64) (kvs []storagepb.KeyValue, rev int64, err error)
+	TxnRange(txnID int64, key, end []byte, limit, rangeRev int64) (kvs []mvccpb.KeyValue, rev int64, err error)
 	TxnPut(txnID int64, key, value []byte, lease lease.LeaseID) (rev int64, err error)
 	TxnPut(txnID int64, key, value []byte, lease lease.LeaseID) (rev int64, err error)
 	TxnDeleteRange(txnID int64, key, end []byte) (n, rev int64, err error)
 	TxnDeleteRange(txnID int64, key, end []byte) (n, rev int64, err error)
 
 

+ 27 - 27
storage/kv_test.go → mvcc/kv_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"fmt"
 	"fmt"
@@ -22,9 +22,9 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
+	"github.com/coreos/etcd/mvcc/backend"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	"github.com/coreos/etcd/storage/backend"
-	"github.com/coreos/etcd/storage/storagepb"
 )
 )
 
 
 // Functional tests for features implemented in v3 store. It treats v3 store
 // Functional tests for features implemented in v3 store. It treats v3 store
@@ -33,16 +33,16 @@ import (
 // TODO: add similar tests on operations in one txn/rev
 // TODO: add similar tests on operations in one txn/rev
 
 
 type (
 type (
-	rangeFunc       func(kv KV, key, end []byte, limit, rangeRev int64) ([]storagepb.KeyValue, int64, error)
+	rangeFunc       func(kv KV, key, end []byte, limit, rangeRev int64) ([]mvccpb.KeyValue, int64, error)
 	putFunc         func(kv KV, key, value []byte, lease lease.LeaseID) int64
 	putFunc         func(kv KV, key, value []byte, lease lease.LeaseID) int64
 	deleteRangeFunc func(kv KV, key, end []byte) (n, rev int64)
 	deleteRangeFunc func(kv KV, key, end []byte) (n, rev int64)
 )
 )
 
 
 var (
 var (
-	normalRangeFunc = func(kv KV, key, end []byte, limit, rangeRev int64) ([]storagepb.KeyValue, int64, error) {
+	normalRangeFunc = func(kv KV, key, end []byte, limit, rangeRev int64) ([]mvccpb.KeyValue, int64, error) {
 		return kv.Range(key, end, limit, rangeRev)
 		return kv.Range(key, end, limit, rangeRev)
 	}
 	}
-	txnRangeFunc = func(kv KV, key, end []byte, limit, rangeRev int64) ([]storagepb.KeyValue, int64, error) {
+	txnRangeFunc = func(kv KV, key, end []byte, limit, rangeRev int64) ([]mvccpb.KeyValue, int64, error) {
 		id := kv.TxnBegin()
 		id := kv.TxnBegin()
 		defer kv.TxnEnd(id)
 		defer kv.TxnEnd(id)
 		return kv.TxnRange(id, key, end, limit, rangeRev)
 		return kv.TxnRange(id, key, end, limit, rangeRev)
@@ -88,7 +88,7 @@ func testKVRange(t *testing.T, f rangeFunc) {
 	wrev := int64(4)
 	wrev := int64(4)
 	tests := []struct {
 	tests := []struct {
 		key, end []byte
 		key, end []byte
-		wkvs     []storagepb.KeyValue
+		wkvs     []mvccpb.KeyValue
 	}{
 	}{
 		// get no keys
 		// get no keys
 		{
 		{
@@ -154,7 +154,7 @@ func testKVRangeRev(t *testing.T, f rangeFunc) {
 	tests := []struct {
 	tests := []struct {
 		rev  int64
 		rev  int64
 		wrev int64
 		wrev int64
-		wkvs []storagepb.KeyValue
+		wkvs []mvccpb.KeyValue
 	}{
 	}{
 		{-1, 4, kvs},
 		{-1, 4, kvs},
 		{0, 4, kvs},
 		{0, 4, kvs},
@@ -223,7 +223,7 @@ func testKVRangeLimit(t *testing.T, f rangeFunc) {
 	wrev := int64(4)
 	wrev := int64(4)
 	tests := []struct {
 	tests := []struct {
 		limit int64
 		limit int64
-		wkvs  []storagepb.KeyValue
+		wkvs  []mvccpb.KeyValue
 	}{
 	}{
 		// no limit
 		// no limit
 		{-1, kvs},
 		{-1, kvs},
@@ -268,7 +268,7 @@ func testKVPutMultipleTimes(t *testing.T, f putFunc) {
 		if err != nil {
 		if err != nil {
 			t.Fatal(err)
 			t.Fatal(err)
 		}
 		}
-		wkvs := []storagepb.KeyValue{
+		wkvs := []mvccpb.KeyValue{
 			{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: base + 1, Version: base, Lease: base},
 			{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: base + 1, Version: base, Lease: base},
 		}
 		}
 		if !reflect.DeepEqual(kvs, wkvs) {
 		if !reflect.DeepEqual(kvs, wkvs) {
@@ -372,7 +372,7 @@ func TestKVOperationInSequence(t *testing.T) {
 		if err != nil {
 		if err != nil {
 			t.Fatal(err)
 			t.Fatal(err)
 		}
 		}
-		wkvs := []storagepb.KeyValue{
+		wkvs := []mvccpb.KeyValue{
 			{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: base + 1, ModRevision: base + 1, Version: 1, Lease: int64(lease.NoLease)},
 			{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: base + 1, ModRevision: base + 1, Version: 1, Lease: int64(lease.NoLease)},
 		}
 		}
 		if !reflect.DeepEqual(kvs, wkvs) {
 		if !reflect.DeepEqual(kvs, wkvs) {
@@ -494,7 +494,7 @@ func TestKVTxnOperationInSequence(t *testing.T) {
 		if err != nil {
 		if err != nil {
 			t.Fatal(err)
 			t.Fatal(err)
 		}
 		}
-		wkvs := []storagepb.KeyValue{
+		wkvs := []mvccpb.KeyValue{
 			{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: base + 1, ModRevision: base + 1, Version: 1, Lease: int64(lease.NoLease)},
 			{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: base + 1, ModRevision: base + 1, Version: 1, Lease: int64(lease.NoLease)},
 		}
 		}
 		if !reflect.DeepEqual(kvs, wkvs) {
 		if !reflect.DeepEqual(kvs, wkvs) {
@@ -542,17 +542,17 @@ func TestKVCompactReserveLastValue(t *testing.T) {
 	tests := []struct {
 	tests := []struct {
 		rev int64
 		rev int64
 		// wanted kvs right after the compacted rev
 		// wanted kvs right after the compacted rev
-		wkvs []storagepb.KeyValue
+		wkvs []mvccpb.KeyValue
 	}{
 	}{
 		{
 		{
 			1,
 			1,
-			[]storagepb.KeyValue{
+			[]mvccpb.KeyValue{
 				{Key: []byte("foo"), Value: []byte("bar0"), CreateRevision: 2, ModRevision: 2, Version: 1, Lease: 1},
 				{Key: []byte("foo"), Value: []byte("bar0"), CreateRevision: 2, ModRevision: 2, Version: 1, Lease: 1},
 			},
 			},
 		},
 		},
 		{
 		{
 			2,
 			2,
-			[]storagepb.KeyValue{
+			[]mvccpb.KeyValue{
 				{Key: []byte("foo"), Value: []byte("bar1"), CreateRevision: 2, ModRevision: 3, Version: 2, Lease: 2},
 				{Key: []byte("foo"), Value: []byte("bar1"), CreateRevision: 2, ModRevision: 3, Version: 2, Lease: 2},
 			},
 			},
 		},
 		},
@@ -562,7 +562,7 @@ func TestKVCompactReserveLastValue(t *testing.T) {
 		},
 		},
 		{
 		{
 			4,
 			4,
-			[]storagepb.KeyValue{
+			[]mvccpb.KeyValue{
 				{Key: []byte("foo"), Value: []byte("bar2"), CreateRevision: 5, ModRevision: 5, Version: 1, Lease: 3},
 				{Key: []byte("foo"), Value: []byte("bar2"), CreateRevision: 5, ModRevision: 5, Version: 1, Lease: 3},
 			},
 			},
 		},
 		},
@@ -656,7 +656,7 @@ func TestKVRestore(t *testing.T) {
 		b, tmpPath := backend.NewDefaultTmpBackend()
 		b, tmpPath := backend.NewDefaultTmpBackend()
 		s := NewStore(b, &lease.FakeLessor{}, nil)
 		s := NewStore(b, &lease.FakeLessor{}, nil)
 		tt(s)
 		tt(s)
-		var kvss [][]storagepb.KeyValue
+		var kvss [][]mvccpb.KeyValue
 		for k := int64(0); k < 10; k++ {
 		for k := int64(0); k < 10; k++ {
 			kvs, _, _ := s.Range([]byte("a"), []byte("z"), 0, k)
 			kvs, _, _ := s.Range([]byte("a"), []byte("z"), 0, k)
 			kvss = append(kvss, kvs)
 			kvss = append(kvss, kvs)
@@ -667,7 +667,7 @@ func TestKVRestore(t *testing.T) {
 		ns := NewStore(b, &lease.FakeLessor{}, nil)
 		ns := NewStore(b, &lease.FakeLessor{}, nil)
 		// wait for possible compaction to finish
 		// wait for possible compaction to finish
 		testutil.WaitSchedule()
 		testutil.WaitSchedule()
-		var nkvss [][]storagepb.KeyValue
+		var nkvss [][]mvccpb.KeyValue
 		for k := int64(0); k < 10; k++ {
 		for k := int64(0); k < 10; k++ {
 			nkvs, _, _ := ns.Range([]byte("a"), []byte("z"), 0, k)
 			nkvs, _, _ := ns.Range([]byte("a"), []byte("z"), 0, k)
 			nkvss = append(nkvss, nkvs)
 			nkvss = append(nkvss, nkvs)
@@ -726,9 +726,9 @@ func TestWatchableKVWatch(t *testing.T) {
 
 
 	wid := w.Watch([]byte("foo"), []byte("fop"), 0)
 	wid := w.Watch([]byte("foo"), []byte("fop"), 0)
 
 
-	wev := []storagepb.Event{
-		{Type: storagepb.PUT,
-			Kv: &storagepb.KeyValue{
+	wev := []mvccpb.Event{
+		{Type: mvccpb.PUT,
+			Kv: &mvccpb.KeyValue{
 				Key:            []byte("foo"),
 				Key:            []byte("foo"),
 				Value:          []byte("bar"),
 				Value:          []byte("bar"),
 				CreateRevision: 2,
 				CreateRevision: 2,
@@ -738,8 +738,8 @@ func TestWatchableKVWatch(t *testing.T) {
 			},
 			},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv: &storagepb.KeyValue{
+			Type: mvccpb.PUT,
+			Kv: &mvccpb.KeyValue{
 				Key:            []byte("foo1"),
 				Key:            []byte("foo1"),
 				Value:          []byte("bar1"),
 				Value:          []byte("bar1"),
 				CreateRevision: 3,
 				CreateRevision: 3,
@@ -749,8 +749,8 @@ func TestWatchableKVWatch(t *testing.T) {
 			},
 			},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv: &storagepb.KeyValue{
+			Type: mvccpb.PUT,
+			Kv: &mvccpb.KeyValue{
 				Key:            []byte("foo1"),
 				Key:            []byte("foo1"),
 				Value:          []byte("bar11"),
 				Value:          []byte("bar11"),
 				CreateRevision: 3,
 				CreateRevision: 3,
@@ -827,11 +827,11 @@ func cleanup(s KV, b backend.Backend, path string) {
 	os.Remove(path)
 	os.Remove(path)
 }
 }
 
 
-func put3TestKVs(s KV) []storagepb.KeyValue {
+func put3TestKVs(s KV) []mvccpb.KeyValue {
 	s.Put([]byte("foo"), []byte("bar"), 1)
 	s.Put([]byte("foo"), []byte("bar"), 1)
 	s.Put([]byte("foo1"), []byte("bar1"), 2)
 	s.Put([]byte("foo1"), []byte("bar1"), 2)
 	s.Put([]byte("foo2"), []byte("bar2"), 3)
 	s.Put([]byte("foo2"), []byte("bar2"), 3)
-	return []storagepb.KeyValue{
+	return []mvccpb.KeyValue{
 		{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1, Lease: 1},
 		{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1, Lease: 1},
 		{Key: []byte("foo1"), Value: []byte("bar1"), CreateRevision: 3, ModRevision: 3, Version: 1, Lease: 2},
 		{Key: []byte("foo1"), Value: []byte("bar1"), CreateRevision: 3, ModRevision: 3, Version: 1, Lease: 2},
 		{Key: []byte("foo2"), Value: []byte("bar2"), CreateRevision: 4, ModRevision: 4, Version: 1, Lease: 3},
 		{Key: []byte("foo2"), Value: []byte("bar2"), CreateRevision: 4, ModRevision: 4, Version: 1, Lease: 3},

+ 31 - 31
storage/kvstore.go → mvcc/kvstore.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"encoding/binary"
 	"encoding/binary"
@@ -24,9 +24,9 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
+	"github.com/coreos/etcd/mvcc/backend"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/schedule"
 	"github.com/coreos/etcd/pkg/schedule"
-	"github.com/coreos/etcd/storage/backend"
-	"github.com/coreos/etcd/storage/storagepb"
 	"golang.org/x/net/context"
 	"golang.org/x/net/context"
 )
 )
 
 
@@ -45,10 +45,10 @@ var (
 	scheduledCompactKeyName = []byte("scheduledCompactRev")
 	scheduledCompactKeyName = []byte("scheduledCompactRev")
 	finishedCompactKeyName  = []byte("finishedCompactRev")
 	finishedCompactKeyName  = []byte("finishedCompactRev")
 
 
-	ErrTxnIDMismatch = errors.New("storage: txn id mismatch")
-	ErrCompacted     = errors.New("storage: required revision has been compacted")
-	ErrFutureRev     = errors.New("storage: required revision is a future revision")
-	ErrCanceled      = errors.New("storage: watcher is canceled")
+	ErrTxnIDMismatch = errors.New("mvcc: txn id mismatch")
+	ErrCompacted     = errors.New("mvcc: required revision has been compacted")
+	ErrFutureRev     = errors.New("mvcc: required revision is a future revision")
+	ErrCanceled      = errors.New("mvcc: watcher is canceled")
 )
 )
 
 
 // ConsistentIndexGetter is an interface that wraps the Get method.
 // ConsistentIndexGetter is an interface that wraps the Get method.
@@ -75,14 +75,14 @@ type store struct {
 	tx    backend.BatchTx
 	tx    backend.BatchTx
 	txnID int64 // tracks the current txnID to verify txn operations
 	txnID int64 // tracks the current txnID to verify txn operations
 
 
-	changes   []storagepb.KeyValue
+	changes   []mvccpb.KeyValue
 	fifoSched schedule.Scheduler
 	fifoSched schedule.Scheduler
 
 
 	stopc chan struct{}
 	stopc chan struct{}
 }
 }
 
 
 // NewStore returns a new store. It is useful to create a store inside
 // NewStore returns a new store. It is useful to create a store inside
-// storage pkg. It should only be used for testing externally.
+// mvcc pkg. It should only be used for testing externally.
 func NewStore(b backend.Backend, le lease.Lessor, ig ConsistentIndexGetter) *store {
 func NewStore(b backend.Backend, le lease.Lessor, ig ConsistentIndexGetter) *store {
 	s := &store{
 	s := &store{
 		b:       b,
 		b:       b,
@@ -142,7 +142,7 @@ func (s *store) Put(key, value []byte, lease lease.LeaseID) int64 {
 	return int64(s.currentRev.main)
 	return int64(s.currentRev.main)
 }
 }
 
 
-func (s *store) Range(key, end []byte, limit, rangeRev int64) (kvs []storagepb.KeyValue, rev int64, err error) {
+func (s *store) Range(key, end []byte, limit, rangeRev int64) (kvs []mvccpb.KeyValue, rev int64, err error) {
 	id := s.TxnBegin()
 	id := s.TxnBegin()
 	kvs, rev, err = s.rangeKeys(key, end, limit, rangeRev)
 	kvs, rev, err = s.rangeKeys(key, end, limit, rangeRev)
 	s.txnEnd(id)
 	s.txnEnd(id)
@@ -201,7 +201,7 @@ func (s *store) txnEnd(txnID int64) error {
 	return nil
 	return nil
 }
 }
 
 
-func (s *store) TxnRange(txnID int64, key, end []byte, limit, rangeRev int64) (kvs []storagepb.KeyValue, rev int64, err error) {
+func (s *store) TxnRange(txnID int64, key, end []byte, limit, rangeRev int64) (kvs []mvccpb.KeyValue, rev int64, err error) {
 	if txnID != s.txnID {
 	if txnID != s.txnID {
 		return nil, 0, ErrTxnIDMismatch
 		return nil, 0, ErrTxnIDMismatch
 	}
 	}
@@ -330,15 +330,15 @@ func (s *store) restore() error {
 	_, finishedCompactBytes := tx.UnsafeRange(metaBucketName, finishedCompactKeyName, nil, 0)
 	_, finishedCompactBytes := tx.UnsafeRange(metaBucketName, finishedCompactKeyName, nil, 0)
 	if len(finishedCompactBytes) != 0 {
 	if len(finishedCompactBytes) != 0 {
 		s.compactMainRev = bytesToRev(finishedCompactBytes[0]).main
 		s.compactMainRev = bytesToRev(finishedCompactBytes[0]).main
-		log.Printf("storage: restore compact to %d", s.compactMainRev)
+		log.Printf("mvcc: restore compact to %d", s.compactMainRev)
 	}
 	}
 
 
 	// TODO: limit N to reduce max memory usage
 	// TODO: limit N to reduce max memory usage
 	keys, vals := tx.UnsafeRange(keyBucketName, min, max, 0)
 	keys, vals := tx.UnsafeRange(keyBucketName, min, max, 0)
 	for i, key := range keys {
 	for i, key := range keys {
-		var kv storagepb.KeyValue
+		var kv mvccpb.KeyValue
 		if err := kv.Unmarshal(vals[i]); err != nil {
 		if err := kv.Unmarshal(vals[i]); err != nil {
-			log.Fatalf("storage: cannot unmarshal event: %v", err)
+			log.Fatalf("mvcc: cannot unmarshal event: %v", err)
 		}
 		}
 
 
 		rev := bytesToRev(key[:revBytesLen])
 		rev := bytesToRev(key[:revBytesLen])
@@ -350,7 +350,7 @@ func (s *store) restore() error {
 			if lease.LeaseID(kv.Lease) != lease.NoLease {
 			if lease.LeaseID(kv.Lease) != lease.NoLease {
 				err := s.le.Detach(lease.LeaseID(kv.Lease), []lease.LeaseItem{{Key: string(kv.Key)}})
 				err := s.le.Detach(lease.LeaseID(kv.Lease), []lease.LeaseItem{{Key: string(kv.Key)}})
 				if err != nil && err != lease.ErrLeaseNotFound {
 				if err != nil && err != lease.ErrLeaseNotFound {
-					log.Fatalf("storage: unexpected Detach error %v", err)
+					log.Fatalf("mvcc: unexpected Detach error %v", err)
 				}
 				}
 			}
 			}
 		default:
 		default:
@@ -387,7 +387,7 @@ func (s *store) restore() error {
 
 
 	if scheduledCompact != 0 {
 	if scheduledCompact != 0 {
 		s.Compact(scheduledCompact)
 		s.Compact(scheduledCompact)
-		log.Printf("storage: resume scheduled compaction at %d", scheduledCompact)
+		log.Printf("mvcc: resume scheduled compaction at %d", scheduledCompact)
 	}
 	}
 
 
 	return nil
 	return nil
@@ -410,7 +410,7 @@ func (a *store) Equal(b *store) bool {
 }
 }
 
 
 // range is a keyword in Go, add Keys suffix.
 // range is a keyword in Go, add Keys suffix.
-func (s *store) rangeKeys(key, end []byte, limit, rangeRev int64) (kvs []storagepb.KeyValue, curRev int64, err error) {
+func (s *store) rangeKeys(key, end []byte, limit, rangeRev int64) (kvs []mvccpb.KeyValue, curRev int64, err error) {
 	curRev = int64(s.currentRev.main)
 	curRev = int64(s.currentRev.main)
 	if s.currentRev.sub > 0 {
 	if s.currentRev.sub > 0 {
 		curRev += 1
 		curRev += 1
@@ -439,12 +439,12 @@ func (s *store) rangeKeys(key, end []byte, limit, rangeRev int64) (kvs []storage
 
 
 		_, vs := s.tx.UnsafeRange(keyBucketName, start, end, 0)
 		_, vs := s.tx.UnsafeRange(keyBucketName, start, end, 0)
 		if len(vs) != 1 {
 		if len(vs) != 1 {
-			log.Fatalf("storage: range cannot find rev (%d,%d)", revpair.main, revpair.sub)
+			log.Fatalf("mvcc: range cannot find rev (%d,%d)", revpair.main, revpair.sub)
 		}
 		}
 
 
-		var kv storagepb.KeyValue
+		var kv mvccpb.KeyValue
 		if err := kv.Unmarshal(vs[0]); err != nil {
 		if err := kv.Unmarshal(vs[0]); err != nil {
-			log.Fatalf("storage: cannot unmarshal event: %v", err)
+			log.Fatalf("mvcc: cannot unmarshal event: %v", err)
 		}
 		}
 		kvs = append(kvs, kv)
 		kvs = append(kvs, kv)
 		if limit > 0 && len(kvs) >= int(limit) {
 		if limit > 0 && len(kvs) >= int(limit) {
@@ -467,9 +467,9 @@ func (s *store) put(key, value []byte, leaseID lease.LeaseID) {
 		ibytes := newRevBytes()
 		ibytes := newRevBytes()
 		revToBytes(grev, ibytes)
 		revToBytes(grev, ibytes)
 		_, vs := s.tx.UnsafeRange(keyBucketName, ibytes, nil, 0)
 		_, vs := s.tx.UnsafeRange(keyBucketName, ibytes, nil, 0)
-		var kv storagepb.KeyValue
+		var kv mvccpb.KeyValue
 		if err = kv.Unmarshal(vs[0]); err != nil {
 		if err = kv.Unmarshal(vs[0]); err != nil {
-			log.Fatalf("storage: cannot unmarshal value: %v", err)
+			log.Fatalf("mvcc: cannot unmarshal value: %v", err)
 		}
 		}
 		oldLease = lease.LeaseID(kv.Lease)
 		oldLease = lease.LeaseID(kv.Lease)
 	}
 	}
@@ -478,7 +478,7 @@ func (s *store) put(key, value []byte, leaseID lease.LeaseID) {
 	revToBytes(revision{main: rev, sub: s.currentRev.sub}, ibytes)
 	revToBytes(revision{main: rev, sub: s.currentRev.sub}, ibytes)
 
 
 	ver = ver + 1
 	ver = ver + 1
-	kv := storagepb.KeyValue{
+	kv := mvccpb.KeyValue{
 		Key:            key,
 		Key:            key,
 		Value:          value,
 		Value:          value,
 		CreateRevision: c,
 		CreateRevision: c,
@@ -489,7 +489,7 @@ func (s *store) put(key, value []byte, leaseID lease.LeaseID) {
 
 
 	d, err := kv.Marshal()
 	d, err := kv.Marshal()
 	if err != nil {
 	if err != nil {
-		log.Fatalf("storage: cannot marshal event: %v", err)
+		log.Fatalf("mvcc: cannot marshal event: %v", err)
 	}
 	}
 
 
 	s.tx.UnsafeSeqPut(keyBucketName, ibytes, d)
 	s.tx.UnsafeSeqPut(keyBucketName, ibytes, d)
@@ -544,19 +544,19 @@ func (s *store) delete(key []byte, rev revision) {
 	revToBytes(revision{main: mainrev, sub: s.currentRev.sub}, ibytes)
 	revToBytes(revision{main: mainrev, sub: s.currentRev.sub}, ibytes)
 	ibytes = appendMarkTombstone(ibytes)
 	ibytes = appendMarkTombstone(ibytes)
 
 
-	kv := storagepb.KeyValue{
+	kv := mvccpb.KeyValue{
 		Key: key,
 		Key: key,
 	}
 	}
 
 
 	d, err := kv.Marshal()
 	d, err := kv.Marshal()
 	if err != nil {
 	if err != nil {
-		log.Fatalf("storage: cannot marshal event: %v", err)
+		log.Fatalf("mvcc: cannot marshal event: %v", err)
 	}
 	}
 
 
 	s.tx.UnsafeSeqPut(keyBucketName, ibytes, d)
 	s.tx.UnsafeSeqPut(keyBucketName, ibytes, d)
 	err = s.kvindex.Tombstone(key, revision{main: mainrev, sub: s.currentRev.sub})
 	err = s.kvindex.Tombstone(key, revision{main: mainrev, sub: s.currentRev.sub})
 	if err != nil {
 	if err != nil {
-		log.Fatalf("storage: cannot tombstone an existing key (%s): %v", string(key), err)
+		log.Fatalf("mvcc: cannot tombstone an existing key (%s): %v", string(key), err)
 	}
 	}
 	s.changes = append(s.changes, kv)
 	s.changes = append(s.changes, kv)
 	s.currentRev.sub += 1
 	s.currentRev.sub += 1
@@ -567,20 +567,20 @@ func (s *store) delete(key []byte, rev revision) {
 
 
 	kv.Reset()
 	kv.Reset()
 	if err = kv.Unmarshal(vs[0]); err != nil {
 	if err = kv.Unmarshal(vs[0]); err != nil {
-		log.Fatalf("storage: cannot unmarshal value: %v", err)
+		log.Fatalf("mvcc: cannot unmarshal value: %v", err)
 	}
 	}
 
 
 	if lease.LeaseID(kv.Lease) != lease.NoLease {
 	if lease.LeaseID(kv.Lease) != lease.NoLease {
 		err = s.le.Detach(lease.LeaseID(kv.Lease), []lease.LeaseItem{{Key: string(kv.Key)}})
 		err = s.le.Detach(lease.LeaseID(kv.Lease), []lease.LeaseItem{{Key: string(kv.Key)}})
 		if err != nil {
 		if err != nil {
-			log.Fatalf("storage: cannot detach %v", err)
+			log.Fatalf("mvcc: cannot detach %v", err)
 		}
 		}
 	}
 	}
 }
 }
 
 
-func (s *store) getChanges() []storagepb.KeyValue {
+func (s *store) getChanges() []mvccpb.KeyValue {
 	changes := s.changes
 	changes := s.changes
-	s.changes = make([]storagepb.KeyValue, 0, 128)
+	s.changes = make([]mvccpb.KeyValue, 0, 128)
 	return changes
 	return changes
 }
 }
 
 

+ 2 - 2
storage/kvstore_bench_test.go → mvcc/kvstore_bench_test.go

@@ -12,14 +12,14 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"log"
 	"log"
 	"testing"
 	"testing"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 func BenchmarkStorePut(b *testing.B) {
 func BenchmarkStorePut(b *testing.B) {

+ 1 - 1
storage/kvstore_compaction.go → mvcc/kvstore_compaction.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"encoding/binary"
 	"encoding/binary"

+ 2 - 2
storage/kvstore_compaction_test.go → mvcc/kvstore_compaction_test.go

@@ -12,14 +12,14 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"reflect"
 	"reflect"
 	"testing"
 	"testing"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 func TestScheduleCompaction(t *testing.T) {
 func TestScheduleCompaction(t *testing.T) {

+ 14 - 14
storage/kvstore_test.go → mvcc/kvstore_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"crypto/rand"
 	"crypto/rand"
@@ -24,10 +24,10 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
+	"github.com/coreos/etcd/mvcc/backend"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/schedule"
 	"github.com/coreos/etcd/pkg/schedule"
 	"github.com/coreos/etcd/pkg/testutil"
 	"github.com/coreos/etcd/pkg/testutil"
-	"github.com/coreos/etcd/storage/backend"
-	"github.com/coreos/etcd/storage/storagepb"
 )
 )
 
 
 func TestStoreRev(t *testing.T) {
 func TestStoreRev(t *testing.T) {
@@ -45,7 +45,7 @@ func TestStoreRev(t *testing.T) {
 }
 }
 
 
 func TestStorePut(t *testing.T) {
 func TestStorePut(t *testing.T) {
-	kv := storagepb.KeyValue{
+	kv := mvccpb.KeyValue{
 		Key:            []byte("foo"),
 		Key:            []byte("foo"),
 		Value:          []byte("bar"),
 		Value:          []byte("bar"),
 		CreateRevision: 1,
 		CreateRevision: 1,
@@ -64,7 +64,7 @@ func TestStorePut(t *testing.T) {
 
 
 		wrev    revision
 		wrev    revision
 		wkey    []byte
 		wkey    []byte
-		wkv     storagepb.KeyValue
+		wkv     mvccpb.KeyValue
 		wputrev revision
 		wputrev revision
 	}{
 	}{
 		{
 		{
@@ -74,7 +74,7 @@ func TestStorePut(t *testing.T) {
 
 
 			revision{1, 1},
 			revision{1, 1},
 			newTestKeyBytes(revision{2, 0}, false),
 			newTestKeyBytes(revision{2, 0}, false),
-			storagepb.KeyValue{
+			mvccpb.KeyValue{
 				Key:            []byte("foo"),
 				Key:            []byte("foo"),
 				Value:          []byte("bar"),
 				Value:          []byte("bar"),
 				CreateRevision: 2,
 				CreateRevision: 2,
@@ -91,7 +91,7 @@ func TestStorePut(t *testing.T) {
 
 
 			revision{1, 2},
 			revision{1, 2},
 			newTestKeyBytes(revision{2, 1}, false),
 			newTestKeyBytes(revision{2, 1}, false),
-			storagepb.KeyValue{
+			mvccpb.KeyValue{
 				Key:            []byte("foo"),
 				Key:            []byte("foo"),
 				Value:          []byte("bar"),
 				Value:          []byte("bar"),
 				CreateRevision: 2,
 				CreateRevision: 2,
@@ -108,7 +108,7 @@ func TestStorePut(t *testing.T) {
 
 
 			revision{2, 1},
 			revision{2, 1},
 			newTestKeyBytes(revision{3, 0}, false),
 			newTestKeyBytes(revision{3, 0}, false),
-			storagepb.KeyValue{
+			mvccpb.KeyValue{
 				Key:            []byte("foo"),
 				Key:            []byte("foo"),
 				Value:          []byte("bar"),
 				Value:          []byte("bar"),
 				CreateRevision: 2,
 				CreateRevision: 2,
@@ -169,7 +169,7 @@ func TestStorePut(t *testing.T) {
 
 
 func TestStoreRange(t *testing.T) {
 func TestStoreRange(t *testing.T) {
 	key := newTestKeyBytes(revision{2, 0}, false)
 	key := newTestKeyBytes(revision{2, 0}, false)
-	kv := storagepb.KeyValue{
+	kv := mvccpb.KeyValue{
 		Key:            []byte("foo"),
 		Key:            []byte("foo"),
 		Value:          []byte("bar"),
 		Value:          []byte("bar"),
 		CreateRevision: 1,
 		CreateRevision: 1,
@@ -210,7 +210,7 @@ func TestStoreRange(t *testing.T) {
 		if err != nil {
 		if err != nil {
 			t.Errorf("#%d: err = %v, want nil", i, err)
 			t.Errorf("#%d: err = %v, want nil", i, err)
 		}
 		}
-		if w := []storagepb.KeyValue{kv}; !reflect.DeepEqual(kvs, w) {
+		if w := []mvccpb.KeyValue{kv}; !reflect.DeepEqual(kvs, w) {
 			t.Errorf("#%d: kvs = %+v, want %+v", i, kvs, w)
 			t.Errorf("#%d: kvs = %+v, want %+v", i, kvs, w)
 		}
 		}
 		if rev != wrev {
 		if rev != wrev {
@@ -240,7 +240,7 @@ func TestStoreRange(t *testing.T) {
 
 
 func TestStoreDeleteRange(t *testing.T) {
 func TestStoreDeleteRange(t *testing.T) {
 	key := newTestKeyBytes(revision{2, 0}, false)
 	key := newTestKeyBytes(revision{2, 0}, false)
-	kv := storagepb.KeyValue{
+	kv := mvccpb.KeyValue{
 		Key:            []byte("foo"),
 		Key:            []byte("foo"),
 		Value:          []byte("bar"),
 		Value:          []byte("bar"),
 		CreateRevision: 1,
 		CreateRevision: 1,
@@ -298,7 +298,7 @@ func TestStoreDeleteRange(t *testing.T) {
 			t.Errorf("#%d: n = %d, want 1", i, n)
 			t.Errorf("#%d: n = %d, want 1", i, n)
 		}
 		}
 
 
-		data, err := (&storagepb.KeyValue{
+		data, err := (&mvccpb.KeyValue{
 			Key: []byte("foo"),
 			Key: []byte("foo"),
 		}).Marshal()
 		}).Marshal()
 		if err != nil {
 		if err != nil {
@@ -367,7 +367,7 @@ func TestStoreRestore(t *testing.T) {
 	fi := s.kvindex.(*fakeIndex)
 	fi := s.kvindex.(*fakeIndex)
 
 
 	putkey := newTestKeyBytes(revision{3, 0}, false)
 	putkey := newTestKeyBytes(revision{3, 0}, false)
-	putkv := storagepb.KeyValue{
+	putkv := mvccpb.KeyValue{
 		Key:            []byte("foo"),
 		Key:            []byte("foo"),
 		Value:          []byte("bar"),
 		Value:          []byte("bar"),
 		CreateRevision: 4,
 		CreateRevision: 4,
@@ -379,7 +379,7 @@ func TestStoreRestore(t *testing.T) {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
 	delkey := newTestKeyBytes(revision{5, 0}, true)
 	delkey := newTestKeyBytes(revision{5, 0}, true)
-	delkv := storagepb.KeyValue{
+	delkv := mvccpb.KeyValue{
 		Key: []byte("foo"),
 		Key: []byte("foo"),
 	}
 	}
 	delkvb, err := delkv.Marshal()
 	delkvb, err := delkv.Marshal()

+ 16 - 16
storage/metrics.go → mvcc/metrics.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus"
@@ -22,7 +22,7 @@ var (
 	rangeCounter = prometheus.NewCounter(
 	rangeCounter = prometheus.NewCounter(
 		prometheus.CounterOpts{
 		prometheus.CounterOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "range_total",
 			Name:      "range_total",
 			Help:      "Total number of ranges seen by this member.",
 			Help:      "Total number of ranges seen by this member.",
 		})
 		})
@@ -30,7 +30,7 @@ var (
 	putCounter = prometheus.NewCounter(
 	putCounter = prometheus.NewCounter(
 		prometheus.CounterOpts{
 		prometheus.CounterOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "put_total",
 			Name:      "put_total",
 			Help:      "Total number of puts seen by this member.",
 			Help:      "Total number of puts seen by this member.",
 		})
 		})
@@ -38,7 +38,7 @@ var (
 	deleteCounter = prometheus.NewCounter(
 	deleteCounter = prometheus.NewCounter(
 		prometheus.CounterOpts{
 		prometheus.CounterOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "delete_total",
 			Name:      "delete_total",
 			Help:      "Total number of deletes seen by this member.",
 			Help:      "Total number of deletes seen by this member.",
 		})
 		})
@@ -46,7 +46,7 @@ var (
 	txnCounter = prometheus.NewCounter(
 	txnCounter = prometheus.NewCounter(
 		prometheus.CounterOpts{
 		prometheus.CounterOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "txn_total",
 			Name:      "txn_total",
 			Help:      "Total number of txns seen by this member.",
 			Help:      "Total number of txns seen by this member.",
 		})
 		})
@@ -54,7 +54,7 @@ var (
 	keysGauge = prometheus.NewGauge(
 	keysGauge = prometheus.NewGauge(
 		prometheus.GaugeOpts{
 		prometheus.GaugeOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "keys_total",
 			Name:      "keys_total",
 			Help:      "Total number of keys.",
 			Help:      "Total number of keys.",
 		})
 		})
@@ -62,7 +62,7 @@ var (
 	watchStreamGauge = prometheus.NewGauge(
 	watchStreamGauge = prometheus.NewGauge(
 		prometheus.GaugeOpts{
 		prometheus.GaugeOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "watch_stream_total",
 			Name:      "watch_stream_total",
 			Help:      "Total number of watch streams.",
 			Help:      "Total number of watch streams.",
 		})
 		})
@@ -70,7 +70,7 @@ var (
 	watcherGauge = prometheus.NewGauge(
 	watcherGauge = prometheus.NewGauge(
 		prometheus.GaugeOpts{
 		prometheus.GaugeOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "watcher_total",
 			Name:      "watcher_total",
 			Help:      "Total number of watchers.",
 			Help:      "Total number of watchers.",
 		})
 		})
@@ -78,7 +78,7 @@ var (
 	slowWatcherGauge = prometheus.NewGauge(
 	slowWatcherGauge = prometheus.NewGauge(
 		prometheus.GaugeOpts{
 		prometheus.GaugeOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "slow_watcher_total",
 			Name:      "slow_watcher_total",
 			Help:      "Total number of unsynced slow watchers.",
 			Help:      "Total number of unsynced slow watchers.",
 		})
 		})
@@ -86,7 +86,7 @@ var (
 	totalEventsCounter = prometheus.NewCounter(
 	totalEventsCounter = prometheus.NewCounter(
 		prometheus.CounterOpts{
 		prometheus.CounterOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "events_total",
 			Name:      "events_total",
 			Help:      "Total number of events sent by this member.",
 			Help:      "Total number of events sent by this member.",
 		})
 		})
@@ -94,7 +94,7 @@ var (
 	pendingEventsGauge = prometheus.NewGauge(
 	pendingEventsGauge = prometheus.NewGauge(
 		prometheus.GaugeOpts{
 		prometheus.GaugeOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "pending_events_total",
 			Name:      "pending_events_total",
 			Help:      "Total number of pending events to be sent.",
 			Help:      "Total number of pending events to be sent.",
 		})
 		})
@@ -102,7 +102,7 @@ var (
 	indexCompactionPauseDurations = prometheus.NewHistogram(
 	indexCompactionPauseDurations = prometheus.NewHistogram(
 		prometheus.HistogramOpts{
 		prometheus.HistogramOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "index_compaction_pause_duration_milliseconds",
 			Name:      "index_compaction_pause_duration_milliseconds",
 			Help:      "Bucketed histogram of index compaction pause duration.",
 			Help:      "Bucketed histogram of index compaction pause duration.",
 			// 0.5ms -> 1second
 			// 0.5ms -> 1second
@@ -112,7 +112,7 @@ var (
 	dbCompactionPauseDurations = prometheus.NewHistogram(
 	dbCompactionPauseDurations = prometheus.NewHistogram(
 		prometheus.HistogramOpts{
 		prometheus.HistogramOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "db_compaction_pause_duration_milliseconds",
 			Name:      "db_compaction_pause_duration_milliseconds",
 			Help:      "Bucketed histogram of db compaction pause duration.",
 			Help:      "Bucketed histogram of db compaction pause duration.",
 			// 1ms -> 4second
 			// 1ms -> 4second
@@ -122,7 +122,7 @@ var (
 	dbCompactionTotalDurations = prometheus.NewHistogram(
 	dbCompactionTotalDurations = prometheus.NewHistogram(
 		prometheus.HistogramOpts{
 		prometheus.HistogramOpts{
 			Namespace: "etcd",
 			Namespace: "etcd",
-			Subsystem: "storage",
+			Subsystem: "mvcc",
 			Name:      "db_compaction_total_duration_milliseconds",
 			Name:      "db_compaction_total_duration_milliseconds",
 			Help:      "Bucketed histogram of db compaction total duration.",
 			Help:      "Bucketed histogram of db compaction total duration.",
 			// 100ms -> 800second
 			// 100ms -> 800second
@@ -131,7 +131,7 @@ var (
 
 
 	dbTotalSize = prometheus.NewGauge(prometheus.GaugeOpts{
 	dbTotalSize = prometheus.NewGauge(prometheus.GaugeOpts{
 		Namespace: "etcd",
 		Namespace: "etcd",
-		Subsystem: "storage",
+		Subsystem: "mvcc",
 		Name:      "db_total_size_in_bytes",
 		Name:      "db_total_size_in_bytes",
 		Help:      "Total size of the underlying database in bytes.",
 		Help:      "Total size of the underlying database in bytes.",
 	})
 	})
@@ -156,7 +156,7 @@ func init() {
 
 
 // ReportEventReceived reports that an event is received.
 // ReportEventReceived reports that an event is received.
 // This function should be called when the external systems received an
 // This function should be called when the external systems received an
-// event from storage.Watcher.
+// event from mvcc.Watcher.
 func ReportEventReceived() {
 func ReportEventReceived() {
 	pendingEventsGauge.Dec()
 	pendingEventsGauge.Dec()
 	totalEventsCounter.Inc()
 	totalEventsCounter.Inc()

+ 24 - 26
storage/storagepb/kv.pb.go → mvcc/mvccpb/kv.pb.go

@@ -3,7 +3,7 @@
 // DO NOT EDIT!
 // DO NOT EDIT!
 
 
 /*
 /*
-	Package storagepb is a generated protocol buffer package.
+	Package mvccpb is a generated protocol buffer package.
 
 
 	It is generated from these files:
 	It is generated from these files:
 		kv.proto
 		kv.proto
@@ -12,7 +12,7 @@
 		KeyValue
 		KeyValue
 		Event
 		Event
 */
 */
-package storagepb
+package mvccpb
 
 
 import (
 import (
 	"fmt"
 	"fmt"
@@ -61,9 +61,9 @@ type KeyValue struct {
 	// key is the key in bytes. An empty key is not allowed.
 	// key is the key in bytes. An empty key is not allowed.
 	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
 	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
 	// create_revision is the revision of last creation on this key.
 	// create_revision is the revision of last creation on this key.
-	CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"`
+	CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,proto3" json:"create_revision,omitempty"`
 	// mod_revision is the revision of last modification on this key.
 	// mod_revision is the revision of last modification on this key.
-	ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"`
+	ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"`
 	// version is the version of the key. A deletion resets
 	// version is the version of the key. A deletion resets
 	// the version to zero and any modification of the key
 	// the version to zero and any modification of the key
 	// increases its version.
 	// increases its version.
@@ -85,7 +85,7 @@ type Event struct {
 	// type is the kind of event. If type is a PUT, it indicates
 	// type is the kind of event. If type is a PUT, it indicates
 	// new data has been stored to the key. If type is a DELETE,
 	// new data has been stored to the key. If type is a DELETE,
 	// it indicates the key was deleted.
 	// it indicates the key was deleted.
-	Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=storagepb.Event_EventType" json:"type,omitempty"`
+	Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"`
 	// kv holds the KeyValue for the event.
 	// kv holds the KeyValue for the event.
 	// A PUT event contains current kv pair.
 	// A PUT event contains current kv pair.
 	// A PUT event with kv.Version=1 indicates the creation of a key.
 	// A PUT event with kv.Version=1 indicates the creation of a key.
@@ -100,9 +100,9 @@ func (*Event) ProtoMessage()               {}
 func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{1} }
 func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{1} }
 
 
 func init() {
 func init() {
-	proto.RegisterType((*KeyValue)(nil), "storagepb.KeyValue")
-	proto.RegisterType((*Event)(nil), "storagepb.Event")
-	proto.RegisterEnum("storagepb.Event_EventType", Event_EventType_name, Event_EventType_value)
+	proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue")
+	proto.RegisterType((*Event)(nil), "mvccpb.Event")
+	proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value)
 }
 }
 func (m *KeyValue) Marshal() (data []byte, err error) {
 func (m *KeyValue) Marshal() (data []byte, err error) {
 	size := m.Size()
 	size := m.Size()
@@ -662,23 +662,21 @@ var (
 )
 )
 
 
 var fileDescriptorKv = []byte{
 var fileDescriptorKv = []byte{
-	// 288 bytes of a gzipped FileDescriptorProto
+	// 255 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xc8, 0x2e, 0xd3, 0x2b,
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xc8, 0x2e, 0xd3, 0x2b,
-	0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x2c, 0x2e, 0xc9, 0x2f, 0x4a, 0x4c, 0x4f, 0x2d, 0x48, 0x92,
-	0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xea, 0x83, 0x58, 0x10, 0x05, 0x4a, 0xeb, 0x18, 0xb9,
-	0x38, 0xbc, 0x53, 0x2b, 0xc3, 0x12, 0x73, 0x4a, 0x53, 0x85, 0x04, 0xb8, 0x98, 0xb3, 0x53, 0x2b,
-	0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0x40, 0x4c, 0x21, 0x75, 0x2e, 0xfe, 0xe4, 0xa2, 0xd4,
-	0xc4, 0x92, 0xd4, 0xf8, 0xa2, 0xd4, 0xb2, 0xcc, 0xe2, 0xcc, 0xfc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0xe2, 0x44, 0x28, 0x65, 0xe7, 0x62, 0x0e, 0x08,
+	0x0d, 0x11, 0x60, 0x10, 0xe2, 0xe2, 0x62, 0x73, 0x71, 0xf5, 0x71, 0x0d, 0x71, 0x15, 0x60, 0x04,
+	0xb1, 0x5d, 0x23, 0x02, 0x3c, 0x83, 0x5c, 0x05, 0x98, 0x9c, 0x44, 0x4e, 0x3c, 0x94, 0x63, 0xb8,
+	0x00, 0xc4, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x00, 0xe2, 0x07, 0x40, 0x9c, 0xc4, 0x06, 0x0e, 0x0f,
+	0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x2d, 0xc3, 0x10, 0x39, 0x01, 0x00, 0x00,
 }
 }

+ 1 - 1
storage/storagepb/kv.proto → mvcc/mvccpb/kv.proto

@@ -1,5 +1,5 @@
 syntax = "proto3";
 syntax = "proto3";
-package storagepb;
+package mvccpb;
 
 
 import "gogoproto/gogo.proto";
 import "gogoproto/gogo.proto";
 
 

+ 1 - 1
storage/revision.go → mvcc/revision.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import "encoding/binary"
 import "encoding/binary"
 
 

+ 1 - 1
storage/revision_test.go → mvcc/revision_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"bytes"
 	"bytes"

+ 22 - 22
storage/watchable_store.go → mvcc/watchable_store.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"log"
 	"log"
@@ -20,8 +20,8 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/backend"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 )
 )
 
 
 const (
 const (
@@ -88,11 +88,11 @@ func (s *watchableStore) Put(key, value []byte, lease lease.LeaseID) (rev int64)
 		log.Panicf("unexpected len(changes) != 1 after put")
 		log.Panicf("unexpected len(changes) != 1 after put")
 	}
 	}
 
 
-	ev := storagepb.Event{
-		Type: storagepb.PUT,
+	ev := mvccpb.Event{
+		Type: mvccpb.PUT,
 		Kv:   &changes[0],
 		Kv:   &changes[0],
 	}
 	}
-	s.notify(rev, []storagepb.Event{ev})
+	s.notify(rev, []mvccpb.Event{ev})
 	return rev
 	return rev
 }
 }
 
 
@@ -111,10 +111,10 @@ func (s *watchableStore) DeleteRange(key, end []byte) (n, rev int64) {
 		return n, rev
 		return n, rev
 	}
 	}
 
 
-	evs := make([]storagepb.Event, n)
+	evs := make([]mvccpb.Event, n)
 	for i, change := range changes {
 	for i, change := range changes {
-		evs[i] = storagepb.Event{
-			Type: storagepb.DELETE,
+		evs[i] = mvccpb.Event{
+			Type: mvccpb.DELETE,
 			Kv:   &change}
 			Kv:   &change}
 		evs[i].Kv.ModRevision = rev
 		evs[i].Kv.ModRevision = rev
 	}
 	}
@@ -140,17 +140,17 @@ func (s *watchableStore) TxnEnd(txnID int64) error {
 	}
 	}
 
 
 	rev := s.store.Rev()
 	rev := s.store.Rev()
-	evs := make([]storagepb.Event, len(changes))
+	evs := make([]mvccpb.Event, len(changes))
 	for i, change := range changes {
 	for i, change := range changes {
 		switch change.CreateRevision {
 		switch change.CreateRevision {
 		case 0:
 		case 0:
-			evs[i] = storagepb.Event{
-				Type: storagepb.DELETE,
+			evs[i] = mvccpb.Event{
+				Type: mvccpb.DELETE,
 				Kv:   &changes[i]}
 				Kv:   &changes[i]}
 			evs[i].Kv.ModRevision = rev
 			evs[i].Kv.ModRevision = rev
 		default:
 		default:
-			evs[i] = storagepb.Event{
-				Type: storagepb.PUT,
+			evs[i] = mvccpb.Event{
+				Type: mvccpb.PUT,
 				Kv:   &changes[i]}
 				Kv:   &changes[i]}
 		}
 		}
 	}
 	}
@@ -308,34 +308,34 @@ func (s *watchableStore) syncWatchers() {
 }
 }
 
 
 // kvsToEvents gets all events for the watchers from all key-value pairs
 // kvsToEvents gets all events for the watchers from all key-value pairs
-func kvsToEvents(wg *watcherGroup, revs, vals [][]byte) (evs []storagepb.Event) {
+func kvsToEvents(wg *watcherGroup, revs, vals [][]byte) (evs []mvccpb.Event) {
 	for i, v := range vals {
 	for i, v := range vals {
-		var kv storagepb.KeyValue
+		var kv mvccpb.KeyValue
 		if err := kv.Unmarshal(v); err != nil {
 		if err := kv.Unmarshal(v); err != nil {
-			log.Panicf("storage: cannot unmarshal event: %v", err)
+			log.Panicf("mvcc: cannot unmarshal event: %v", err)
 		}
 		}
 
 
 		if !wg.contains(string(kv.Key)) {
 		if !wg.contains(string(kv.Key)) {
 			continue
 			continue
 		}
 		}
 
 
-		ty := storagepb.PUT
+		ty := mvccpb.PUT
 		if isTombstone(revs[i]) {
 		if isTombstone(revs[i]) {
-			ty = storagepb.DELETE
+			ty = mvccpb.DELETE
 			// patch in mod revision so watchers won't skip
 			// patch in mod revision so watchers won't skip
 			kv.ModRevision = bytesToRev(revs[i]).main
 			kv.ModRevision = bytesToRev(revs[i]).main
 		}
 		}
-		evs = append(evs, storagepb.Event{Kv: &kv, Type: ty})
+		evs = append(evs, mvccpb.Event{Kv: &kv, Type: ty})
 	}
 	}
 	return evs
 	return evs
 }
 }
 
 
 // notify notifies the fact that given event at the given rev just happened to
 // notify notifies the fact that given event at the given rev just happened to
 // watchers that watch on the key of the event.
 // watchers that watch on the key of the event.
-func (s *watchableStore) notify(rev int64, evs []storagepb.Event) {
+func (s *watchableStore) notify(rev int64, evs []mvccpb.Event) {
 	for w, eb := range newWatcherBatch(&s.synced, evs) {
 	for w, eb := range newWatcherBatch(&s.synced, evs) {
 		if eb.revs != 1 {
 		if eb.revs != 1 {
-			panic("unexpected multiple revisions in notification")
+			log.Panicf("mvcc: unexpected multiple revisions in notification")
 		}
 		}
 		select {
 		select {
 		case w.ch <- WatchResponse{WatchID: w.id, Events: eb.evs, Revision: s.Rev()}:
 		case w.ch <- WatchResponse{WatchID: w.id, Events: eb.evs, Revision: s.Rev()}:

+ 2 - 2
storage/watchable_store_bench_test.go → mvcc/watchable_store_bench_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"math/rand"
 	"math/rand"
@@ -20,7 +20,7 @@ import (
 	"testing"
 	"testing"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 // Benchmarks on cancel function performance for unsynced watchers
 // Benchmarks on cancel function performance for unsynced watchers

+ 19 - 19
storage/watchable_store_test.go → mvcc/watchable_store_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"bytes"
 	"bytes"
@@ -22,8 +22,8 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/backend"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 )
 )
 
 
 func TestWatch(t *testing.T) {
 func TestWatch(t *testing.T) {
@@ -206,8 +206,8 @@ func TestSyncWatchers(t *testing.T) {
 	if len(evs) != 1 {
 	if len(evs) != 1 {
 		t.Errorf("len(evs) got = %d, want = 1", len(evs))
 		t.Errorf("len(evs) got = %d, want = 1", len(evs))
 	}
 	}
-	if evs[0].Type != storagepb.PUT {
-		t.Errorf("got = %v, want = %v", evs[0].Type, storagepb.PUT)
+	if evs[0].Type != mvccpb.PUT {
+		t.Errorf("got = %v, want = %v", evs[0].Type, mvccpb.PUT)
 	}
 	}
 	if !bytes.Equal(evs[0].Kv.Key, testKey) {
 	if !bytes.Equal(evs[0].Kv.Key, testKey) {
 		t.Errorf("got = %s, want = %s", evs[0].Kv.Key, testKey)
 		t.Errorf("got = %s, want = %s", evs[0].Kv.Key, testKey)
@@ -334,32 +334,32 @@ func TestNewMapwatcherToEventMap(t *testing.T) {
 
 
 	ws := []*watcher{{key: k0}, {key: k1}, {key: k2}}
 	ws := []*watcher{{key: k0}, {key: k1}, {key: k2}}
 
 
-	evs := []storagepb.Event{
+	evs := []mvccpb.Event{
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: k0, Value: v0},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: k0, Value: v0},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: k1, Value: v1},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: k1, Value: v1},
 		},
 		},
 		{
 		{
-			Type: storagepb.PUT,
-			Kv:   &storagepb.KeyValue{Key: k2, Value: v2},
+			Type: mvccpb.PUT,
+			Kv:   &mvccpb.KeyValue{Key: k2, Value: v2},
 		},
 		},
 	}
 	}
 
 
 	tests := []struct {
 	tests := []struct {
 		sync []*watcher
 		sync []*watcher
-		evs  []storagepb.Event
+		evs  []mvccpb.Event
 
 
-		wwe map[*watcher][]storagepb.Event
+		wwe map[*watcher][]mvccpb.Event
 	}{
 	}{
 		// no watcher in sync, some events should return empty wwe
 		// no watcher in sync, some events should return empty wwe
 		{
 		{
 			nil,
 			nil,
 			evs,
 			evs,
-			map[*watcher][]storagepb.Event{},
+			map[*watcher][]mvccpb.Event{},
 		},
 		},
 
 
 		// one watcher in sync, one event that does not match the key of that
 		// one watcher in sync, one event that does not match the key of that
@@ -367,7 +367,7 @@ func TestNewMapwatcherToEventMap(t *testing.T) {
 		{
 		{
 			[]*watcher{ws[2]},
 			[]*watcher{ws[2]},
 			evs[:1],
 			evs[:1],
-			map[*watcher][]storagepb.Event{},
+			map[*watcher][]mvccpb.Event{},
 		},
 		},
 
 
 		// one watcher in sync, one event that matches the key of that
 		// one watcher in sync, one event that matches the key of that
@@ -375,7 +375,7 @@ func TestNewMapwatcherToEventMap(t *testing.T) {
 		{
 		{
 			[]*watcher{ws[1]},
 			[]*watcher{ws[1]},
 			evs[1:2],
 			evs[1:2],
-			map[*watcher][]storagepb.Event{
+			map[*watcher][]mvccpb.Event{
 				ws[1]: evs[1:2],
 				ws[1]: evs[1:2],
 			},
 			},
 		},
 		},
@@ -386,7 +386,7 @@ func TestNewMapwatcherToEventMap(t *testing.T) {
 		{
 		{
 			[]*watcher{ws[0], ws[2]},
 			[]*watcher{ws[0], ws[2]},
 			evs[2:],
 			evs[2:],
-			map[*watcher][]storagepb.Event{
+			map[*watcher][]mvccpb.Event{
 				ws[2]: evs[2:],
 				ws[2]: evs[2:],
 			},
 			},
 		},
 		},
@@ -396,7 +396,7 @@ func TestNewMapwatcherToEventMap(t *testing.T) {
 		{
 		{
 			[]*watcher{ws[0], ws[1]},
 			[]*watcher{ws[0], ws[1]},
 			evs[:2],
 			evs[:2],
-			map[*watcher][]storagepb.Event{
+			map[*watcher][]mvccpb.Event{
 				ws[0]: evs[:1],
 				ws[0]: evs[:1],
 				ws[1]: evs[1:2],
 				ws[1]: evs[1:2],
 			},
 			},

+ 4 - 4
storage/watcher.go → mvcc/watcher.go

@@ -12,17 +12,17 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"errors"
 	"errors"
 	"sync"
 	"sync"
 
 
-	"github.com/coreos/etcd/storage/storagepb"
+	"github.com/coreos/etcd/mvcc/mvccpb"
 )
 )
 
 
 var (
 var (
-	ErrWatcherNotExist = errors.New("storage: watcher does not exist")
+	ErrWatcherNotExist = errors.New("mvcc: watcher does not exist")
 )
 )
 
 
 type WatchID int64
 type WatchID int64
@@ -66,7 +66,7 @@ type WatchResponse struct {
 	WatchID WatchID
 	WatchID WatchID
 
 
 	// Events contains all the events that needs to send.
 	// Events contains all the events that needs to send.
-	Events []storagepb.Event
+	Events []mvccpb.Event
 
 
 	// Revision is the revision of the KV when the watchResponse is created.
 	// Revision is the revision of the KV when the watchResponse is created.
 	// For a normal response, the revision should be the same as the last
 	// For a normal response, the revision should be the same as the last

+ 2 - 2
storage/watcher_bench_test.go → mvcc/watcher_bench_test.go

@@ -12,14 +12,14 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"fmt"
 	"fmt"
 	"testing"
 	"testing"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 func BenchmarkKVWatcherMemoryUsage(b *testing.B) {
 func BenchmarkKVWatcherMemoryUsage(b *testing.B) {

+ 6 - 6
storage/watcher_group.go → mvcc/watcher_group.go

@@ -12,13 +12,13 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"math"
 	"math"
 
 
+	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/coreos/etcd/pkg/adt"
 	"github.com/coreos/etcd/pkg/adt"
-	"github.com/coreos/etcd/storage/storagepb"
 )
 )
 
 
 var (
 var (
@@ -30,14 +30,14 @@ var (
 
 
 type eventBatch struct {
 type eventBatch struct {
 	// evs is a batch of revision-ordered events
 	// evs is a batch of revision-ordered events
-	evs []storagepb.Event
+	evs []mvccpb.Event
 	// revs is the minimum unique revisions observed for this batch
 	// revs is the minimum unique revisions observed for this batch
 	revs int
 	revs int
 	// moreRev is first revision with more events following this batch
 	// moreRev is first revision with more events following this batch
 	moreRev int64
 	moreRev int64
 }
 }
 
 
-func (eb *eventBatch) add(ev storagepb.Event) {
+func (eb *eventBatch) add(ev mvccpb.Event) {
 	if eb.revs > watchBatchMaxRevs {
 	if eb.revs > watchBatchMaxRevs {
 		// maxed out batch size
 		// maxed out batch size
 		return
 		return
@@ -66,7 +66,7 @@ func (eb *eventBatch) add(ev storagepb.Event) {
 
 
 type watcherBatch map[*watcher]*eventBatch
 type watcherBatch map[*watcher]*eventBatch
 
 
-func (wb watcherBatch) add(w *watcher, ev storagepb.Event) {
+func (wb watcherBatch) add(w *watcher, ev mvccpb.Event) {
 	eb := wb[w]
 	eb := wb[w]
 	if eb == nil {
 	if eb == nil {
 		eb = &eventBatch{}
 		eb = &eventBatch{}
@@ -82,7 +82,7 @@ func (wb watcherBatch) contains(w *watcher) bool {
 
 
 // newWatcherBatch maps watchers to their matched events. It enables quick
 // newWatcherBatch maps watchers to their matched events. It enables quick
 // events look up by watcher.
 // events look up by watcher.
-func newWatcherBatch(wg *watcherGroup, evs []storagepb.Event) watcherBatch {
+func newWatcherBatch(wg *watcherGroup, evs []mvccpb.Event) watcherBatch {
 	wb := make(watcherBatch)
 	wb := make(watcherBatch)
 	for _, ev := range evs {
 	for _, ev := range evs {
 		for w := range wg.watcherSetByKey(string(ev.Kv.Key)) {
 		for w := range wg.watcherSetByKey(string(ev.Kv.Key)) {

+ 2 - 2
storage/watcher_test.go → mvcc/watcher_test.go

@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // See the License for the specific language governing permissions and
 // limitations under the License.
 // limitations under the License.
 
 
-package storage
+package mvcc
 
 
 import (
 import (
 	"bytes"
 	"bytes"
@@ -22,7 +22,7 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc/backend"
 )
 )
 
 
 // TestWatcherWatchID tests that each watcher provides unique watchID,
 // TestWatcherWatchID tests that each watcher provides unique watchID,

+ 52 - 56
raft/raftpb/raft.pb.go

@@ -183,10 +183,10 @@ func (x *ConfChangeType) UnmarshalJSON(data []byte) error {
 func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
 func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
 
 
 type Entry struct {
 type Entry struct {
-	Type             EntryType `protobuf:"varint,1,opt,name=Type,json=type,enum=raftpb.EntryType" json:"Type"`
-	Term             uint64    `protobuf:"varint,2,opt,name=Term,json=term" json:"Term"`
-	Index            uint64    `protobuf:"varint,3,opt,name=Index,json=index" json:"Index"`
-	Data             []byte    `protobuf:"bytes,4,opt,name=Data,json=data" json:"Data,omitempty"`
+	Type             EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"`
+	Term             uint64    `protobuf:"varint,2,opt,name=Term" json:"Term"`
+	Index            uint64    `protobuf:"varint,3,opt,name=Index" json:"Index"`
+	Data             []byte    `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"`
 	XXX_unrecognized []byte    `json:"-"`
 	XXX_unrecognized []byte    `json:"-"`
 }
 }
 
 
@@ -196,7 +196,7 @@ func (*Entry) ProtoMessage()               {}
 func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
 func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
 
 
 type SnapshotMetadata struct {
 type SnapshotMetadata struct {
-	ConfState        ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"`
+	ConfState        ConfState `protobuf:"bytes,1,opt,name=conf_state" json:"conf_state"`
 	Index            uint64    `protobuf:"varint,2,opt,name=index" json:"index"`
 	Index            uint64    `protobuf:"varint,2,opt,name=index" json:"index"`
 	Term             uint64    `protobuf:"varint,3,opt,name=term" json:"term"`
 	Term             uint64    `protobuf:"varint,3,opt,name=term" json:"term"`
 	XXX_unrecognized []byte    `json:"-"`
 	XXX_unrecognized []byte    `json:"-"`
@@ -261,10 +261,10 @@ func (*ConfState) ProtoMessage()               {}
 func (*ConfState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{5} }
 func (*ConfState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{5} }
 
 
 type ConfChange struct {
 type ConfChange struct {
-	ID               uint64         `protobuf:"varint,1,opt,name=ID,json=iD" json:"ID"`
-	Type             ConfChangeType `protobuf:"varint,2,opt,name=Type,json=type,enum=raftpb.ConfChangeType" json:"Type"`
-	NodeID           uint64         `protobuf:"varint,3,opt,name=NodeID,json=nodeID" json:"NodeID"`
-	Context          []byte         `protobuf:"bytes,4,opt,name=Context,json=context" json:"Context,omitempty"`
+	ID               uint64         `protobuf:"varint,1,opt,name=ID" json:"ID"`
+	Type             ConfChangeType `protobuf:"varint,2,opt,name=Type,enum=raftpb.ConfChangeType" json:"Type"`
+	NodeID           uint64         `protobuf:"varint,3,opt,name=NodeID" json:"NodeID"`
+	Context          []byte         `protobuf:"bytes,4,opt,name=Context" json:"Context,omitempty"`
 	XXX_unrecognized []byte         `json:"-"`
 	XXX_unrecognized []byte         `json:"-"`
 }
 }
 
 
@@ -1788,51 +1788,47 @@ var (
 )
 )
 
 
 var fileDescriptorRaft = []byte{
 var fileDescriptorRaft = []byte{
-	// 735 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x54, 0x4d, 0x6f, 0xd3, 0x4a,
-	0x14, 0xad, 0x13, 0xe7, 0xeb, 0xa6, 0x4d, 0xa7, 0xd3, 0xbc, 0x27, 0xab, 0x7a, 0xea, 0xeb, 0xb3,
-	0xde, 0x02, 0x15, 0xb5, 0x40, 0x17, 0x2c,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0x2d, 0xab, 0xd7, 0x82, 0xb4, 0x28, 0x81, 0x45, 0xdd,
-	0x8c, 0x33, 0xa9, 0x2e, 0x74, 0x97, 0x36, 0x3a, 0x48, 0xca, 0x88, 0x49, 0xea, 0xe0, 0xe7, 0xdb,
-	0x43, 0xf4, 0x3c, 0x91, 0x9c, 0x05, 0x23, 0x76, 0x71, 0xc9, 0x09, 0xd0, 0x15, 0x58, 0xb2, 0x85,
-	0xf4, 0x03, 0x4d, 0x32, 0xd2, 0xb5, 0x61, 0xfb, 0x23, 0x1e, 0x7c, 0x7c, 0x35, 0x11, 0x72, 0x12,
-	0x93, 0x45, 0xfa, 0x17, 0xac, 0x20, 0x76, 0x26, 0x59, 0x92, 0x0d, 0xb9, 0x7c, 0xc1, 0x59, 0xc8,
-	0x25, 0x59, 0xb2, 0xd9, 0x67, 0xe3, 0x98, 0x8b, 0x89, 0x3a, 0x11, 0x9f, 0x48, 0x6f, 0xf3, 0x2d,
-	0xf4, 0xaa, 0x4f, 0xa2, 0x73, 0x67, 0xc8, 0x6e, 0x18, 0xea, 0x37, 0x41, 0x5b, 0x3c, 0xe8, 0xcf,
-	0xe0, 0x01, 0x8f, 0xc5, 0x15, 0x37, 0x8c, 0x53, 0x65, 0xce, 0x53, 0xfc, 0xab, 0xc8, 0x99, 0xda,
-	0x5e, 0xff, 0xf6, 0xd7, 0xfa, 0xc2, 0x1d, 0xfe, 0x6e, 0x7f, 0xaf, 0x3b, 0x77, 0xf8, 0xfb, 0x89,
-	0xbf, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x26, 0x45, 0x2d, 0xd0, 0x05, 0x00, 0x00,
+	// 657 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x53, 0xdd, 0x6e, 0xd3, 0x4c,
+	0x10, 0xad, 0x5d, 0x27, 0x76, 0xc6, 0x49, 0xba, 0x75, 0xf3, 0x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, 0x5c, 0x57, 0x11, 0x3b, 0x17, 0x34, 0x2f, 0x27, 0x4c,
+	0xbc, 0x63, 0x34, 0x61, 0x82, 0xf4, 0x4c, 0xf6, 0xf9, 0x2c, 0x63, 0x7c, 0x2e, 0x4f, 0xf8, 0x77,
+	0xd2, 0x1f, 0x7d, 0x82, 0x7e, 0x73, 0xf7, 0x2a, 0xb7, 0x46, 0x76, 0x93, 0x44, 0x59, 0x40, 0xd4,
+	0x65, 0x0d, 0x6a, 0xf8, 0x94, 0x65, 0xfc, 0x9a, 0x69, 0xc6, 0x69, 0x32, 0x17, 0x05, 0xfe, 0xa4,
+	0x15, 0xe3, 0xee, 0x0d, 0xee, 0xfe, 0x6c, 0x2c, 0xdd, 0xe3, 0x73, 0xf7, 0x77, 0xc3, 0xb9, 0xc7,
+	0xe7, 0x37, 0x3e, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x27, 0xd9, 0xba, 0x02, 0x05, 0x00,
+	0x00,
 }
 }

+ 2 - 2
scripts/genproto.sh

@@ -17,7 +17,7 @@ if ! [[ $(protoc --version) =~ "3.0.0" ]]; then
 fi
 fi
 
 
 # directories containing protos to be built
 # directories containing protos to be built
-DIRS="./wal/walpb ./etcdserver/etcdserverpb ./snap/snappb ./raft/raftpb ./storage/storagepb ./lease/leasepb ./auth/authpb"
+DIRS="./wal/walpb ./etcdserver/etcdserverpb ./snap/snappb ./raft/raftpb ./mvcc/mvccpb ./lease/leasepb ./auth/authpb"
 
 
 # exact version of protoc-gen-gogo to build
 # exact version of protoc-gen-gogo to build
 SHA="c3995ae437bb78d1189f4f147dfe5f87ad3596e4"
 SHA="c3995ae437bb78d1189f4f147dfe5f87ad3596e4"
@@ -75,7 +75,7 @@ if [ "$1" = "-g" ]; then
 		echo "protodoc is updated"
 		echo "protodoc is updated"
 	popd
 	popd
 
 
-	protodoc --directories="etcdserver/etcdserverpb=service_message,storage/storagepb=service_message,lease/leasepb=service_message,auth/authpb=service_message" \
+	protodoc --directories="etcdserver/etcdserverpb=service_message,mvcc/mvccpb=service_message,lease/leasepb=service_message,auth/authpb=service_message" \
 		--title="etcd API Reference" \
 		--title="etcd API Reference" \
 		--output="Documentation/dev-guide/api_reference_v3.md" \
 		--output="Documentation/dev-guide/api_reference_v3.md" \
 		--message-only-from-this-file="etcdserver/etcdserverpb/rpc.proto"
 		--message-only-from-this-file="etcdserver/etcdserverpb/rpc.proto"

+ 6 - 7
snap/snappb/snap.pb.go

@@ -337,13 +337,12 @@ var (
 )
 )
 
 
 var fileDescriptorSnap = []byte{
 var fileDescriptorSnap = []byte{
-	// 118 bytes of a gzipped FileDescriptorProto
+	// 112 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xce, 0x4b, 0x2c,
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xce, 0x4b, 0x2c,
 	0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
 	0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3,
-	0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0xc9, 0x8c, 0x8b, 0x03, 0x24, 0x5f, 0x9c,
-	0x91, 0x5f, 0x22, 0x24, 0xc6, 0xc5, 0x9c, 0x5c, 0x94, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xeb,
-	0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x48, 0x40, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24,
-	0x51, 0x82, 0x09, 0x28, 0xc1, 0x13, 0x04, 0x66, 0x3b, 0x09, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe2,
-	0x91, 0x1c, 0xe3, 0x05, 0x20, 0x7e, 0x00, 0xc4, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x03,
-	0x97, 0xa7, 0x74, 0x00, 0x00, 0x00,
+	0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0x49, 0x9b, 0x8b, 0x03, 0x24, 0x5f, 0x9c,
+	0x91, 0x5f, 0x22, 0x24, 0xc8, 0xc5, 0x9c, 0x5c, 0x94, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xeb,
+	0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x83, 0x10, 0x0f, 0x17, 0x4b, 0x4a, 0x62, 0x49, 0xa2, 0x04, 0x13,
+	0x50, 0x8c, 0xc7, 0x49, 0xe0, 0xc4, 0x43, 0x39, 0x86, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x00, 0xf1,
+	0x03, 0x20, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x89, 0xff, 0x64, 0x86, 0x69, 0x00, 0x00, 0x00,
 }
 }

+ 2 - 2
test

@@ -28,7 +28,7 @@ ln -s ${PWD}/cmd/vendor $GOPATH/src
 
 
 # Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt.
 # Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt.
 PKGS=`ls pkg/*/*go  | cut -f1,2 -d/ | sort | uniq`
 PKGS=`ls pkg/*/*go  | cut -f1,2 -d/ | sort | uniq`
-TESTABLE_AND_FORMATTABLE="client clientv3 discovery error etcdctl/ctlv2 etcdctl/ctlv3 etcdmain etcdserver etcdserver/auth etcdserver/api/v2http etcdserver/api/v2http/httptypes $PKGS proxy/httpproxy proxy/tcpproxy raft snap storage storage/backend store version wal rafthttp"
+TESTABLE_AND_FORMATTABLE="client clientv3 discovery error etcdctl/ctlv2 etcdctl/ctlv3 etcdmain etcdserver etcdserver/auth etcdserver/api/v2http etcdserver/api/v2http/httptypes $PKGS proxy/httpproxy proxy/tcpproxy raft snap mvcc mvcc/backend store version wal rafthttp"
 FORMATTABLE="$TESTABLE_AND_FORMATTABLE *.go etcdctl/ integration clientv3/integration e2e alarm"
 FORMATTABLE="$TESTABLE_AND_FORMATTABLE *.go etcdctl/ integration clientv3/integration e2e alarm"
 
 
 # user has not provided PKG override
 # user has not provided PKG override
@@ -153,7 +153,7 @@ function dep_tests {
 	echo "Checking package dependencies..."
 	echo "Checking package dependencies..."
 	# don't pull in etcdserver package
 	# don't pull in etcdserver package
 	pushd clientv3 >/dev/null
 	pushd clientv3 >/dev/null
-	badpkg="(etcdserver|storage)"
+	badpkg="(etcdserver|mvcc)"
 	deps=`go list -f '{{ .Deps }}'  | sed 's/ /\n/g' | egrep "${badpkg}" | egrep -v "${badpkg}/" || echo ""`
 	deps=`go list -f '{{ .Deps }}'  | sed 's/ /\n/g' | egrep "${badpkg}" | egrep -v "${badpkg}/" || echo ""`
 	popd >/dev/null
 	popd >/dev/null
 	if [ ! -z "$deps" ]; then
 	if [ ! -z "$deps" ]; then

+ 11 - 11
tools/benchmark/cmd/storage-put.go → tools/benchmark/cmd/mvcc-put.go

@@ -25,12 +25,12 @@ import (
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra"
 )
 )
 
 
-// storagePutCmd represents a storage put performance benchmarking tool
-var storagePutCmd = &cobra.Command{
+// mvccPutCmd represents a storage put performance benchmarking tool
+var mvccPutCmd = &cobra.Command{
 	Use:   "put",
 	Use:   "put",
 	Short: "Benchmark put performance of storage",
 	Short: "Benchmark put performance of storage",
 
 
-	Run: storagePutFunc,
+	Run: mvccPutFunc,
 }
 }
 
 
 var (
 var (
@@ -41,16 +41,16 @@ var (
 )
 )
 
 
 func init() {
 func init() {
-	storageCmd.AddCommand(storagePutCmd)
+	mvccCmd.AddCommand(mvccPutCmd)
 
 
-	storagePutCmd.Flags().IntVar(&totalNrKeys, "total", 100, "a total number of keys to put")
-	storagePutCmd.Flags().IntVar(&storageKeySize, "key-size", 64, "a size of key (Byte)")
-	storagePutCmd.Flags().IntVar(&valueSize, "value-size", 64, "a size of value (Byte)")
-	storagePutCmd.Flags().BoolVar(&txn, "txn", false, "put a key in transaction or not")
+	mvccPutCmd.Flags().IntVar(&totalNrKeys, "total", 100, "a total number of keys to put")
+	mvccPutCmd.Flags().IntVar(&storageKeySize, "key-size", 64, "a size of key (Byte)")
+	mvccPutCmd.Flags().IntVar(&valueSize, "value-size", 64, "a size of value (Byte)")
+	mvccPutCmd.Flags().BoolVar(&txn, "txn", false, "put a key in transaction or not")
 
 
 	// TODO: after the PR https://github.com/spf13/cobra/pull/220 is merged, the below pprof related flags should be moved to RootCmd
 	// TODO: after the PR https://github.com/spf13/cobra/pull/220 is merged, the below pprof related flags should be moved to RootCmd
-	storagePutCmd.Flags().StringVar(&cpuProfPath, "cpuprofile", "", "the path of file for storing cpu profile result")
-	storagePutCmd.Flags().StringVar(&memProfPath, "memprofile", "", "the path of file for storing heap profile result")
+	mvccPutCmd.Flags().StringVar(&cpuProfPath, "cpuprofile", "", "the path of file for storing cpu profile result")
+	mvccPutCmd.Flags().StringVar(&memProfPath, "memprofile", "", "the path of file for storing heap profile result")
 
 
 }
 }
 
 
@@ -65,7 +65,7 @@ func createBytesSlice(bytesN, sliceN int) [][]byte {
 	return rs
 	return rs
 }
 }
 
 
-func storagePutFunc(cmd *cobra.Command, args []string) {
+func mvccPutFunc(cmd *cobra.Command, args []string) {
 	if cpuProfPath != "" {
 	if cpuProfPath != "" {
 		f, err := os.Create(cpuProfPath)
 		f, err := os.Create(cpuProfPath)
 		if err != nil {
 		if err != nil {

+ 18 - 18
tools/benchmark/cmd/storage.go → tools/benchmark/cmd/mvcc.go

@@ -19,8 +19,8 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/lease"
-	"github.com/coreos/etcd/storage"
-	"github.com/coreos/etcd/storage/backend"
+	"github.com/coreos/etcd/mvcc"
+	"github.com/coreos/etcd/mvcc/backend"
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra"
 )
 )
 
 
@@ -28,32 +28,32 @@ var (
 	batchInterval int
 	batchInterval int
 	batchLimit    int
 	batchLimit    int
 
 
-	s storage.KV
+	s mvcc.KV
 )
 )
 
 
-func initStorage() {
-	be := backend.New("storage-bench", time.Duration(batchInterval), batchLimit)
-	s = storage.NewStore(be, &lease.FakeLessor{}, nil)
-	os.Remove("storage-bench") // boltDB has an opened fd, so removing the file is ok
+func initMVCC() {
+	be := backend.New("mvcc-bench", time.Duration(batchInterval), batchLimit)
+	s = mvcc.NewStore(be, &lease.FakeLessor{}, nil)
+	os.Remove("mvcc-bench") // boltDB has an opened fd, so removing the file is ok
 }
 }
 
 
-// storageCmd represents the storage benchmarking tools
-var storageCmd = &cobra.Command{
-	Use:   "storage",
-	Short: "Benchmark storage",
-	Long: `storage subcommand is a set of various benchmark tools for storage subsystem of etcd.
+// mvccCmd represents the MVCC storage benchmarking tools
+var mvccCmd = &cobra.Command{
+	Use:   "mvcc",
+	Short: "Benchmark mvcc",
+	Long: `storage subcommand is a set of various benchmark tools for MVCC storage subsystem of etcd.
 Actual benchmarks are implemented as its subcommands.`,
 Actual benchmarks are implemented as its subcommands.`,
 
 
-	PersistentPreRun: storagePreRun,
+	PersistentPreRun: mvccPreRun,
 }
 }
 
 
 func init() {
 func init() {
-	RootCmd.AddCommand(storageCmd)
+	RootCmd.AddCommand(mvccCmd)
 
 
-	storageCmd.PersistentFlags().IntVar(&batchInterval, "batch-interval", 100, "Interval of batching (milliseconds)")
-	storageCmd.PersistentFlags().IntVar(&batchLimit, "batch-limit", 10000, "A limit of batched transaction")
+	mvccCmd.PersistentFlags().IntVar(&batchInterval, "batch-interval", 100, "Interval of batching (milliseconds)")
+	mvccCmd.PersistentFlags().IntVar(&batchLimit, "batch-limit", 10000, "A limit of batched transaction")
 }
 }
 
 
-func storagePreRun(cmd *cobra.Command, args []string) {
-	initStorage()
+func mvccPreRun(cmd *cobra.Command, args []string) {
+	initMVCC()
 }
 }

+ 10 - 10
wal/walpb/record.pb.go

@@ -501,16 +501,16 @@ var (
 )
 )
 
 
 var fileDescriptorRecord = []byte{
 var fileDescriptorRecord = []byte{
-	// 175 bytes of a gzipped FileDescriptorProto
+	// 161 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4a, 0x4d, 0xce,
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4a, 0x4d, 0xce,
 	0x2f, 0x4a, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0x4f, 0xcc, 0x29, 0x48, 0x92,
 	0x2f, 0x4a, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0x4f, 0xcc, 0x29, 0x48, 0x92,
-	0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xe8, 0x83, 0x58, 0x10, 0x49, 0x25, 0x3f, 0x2e, 0xb6,
-	0x20, 0xb0, 0x62, 0x21, 0x09, 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d,
-	0x66, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xc0, 0x22, 0x42, 0x62, 0x5c, 0xcc, 0xc9, 0x45,
-	0xc9, 0x12, 0x4c, 0x40, 0x09, 0x5e, 0xa8, 0x04, 0x48, 0x40, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1,
-	0x24, 0x51, 0x82, 0x19, 0x28, 0xc1, 0x13, 0x04, 0x66, 0x2b, 0x39, 0x70, 0x71, 0x04, 0xe7, 0x25,
-	0x16, 0x14, 0x67, 0xe4, 0x97, 0x08, 0x49, 0x71, 0xb1, 0x66, 0xe6, 0xa5, 0xa4, 0x56, 0x80, 0x8d,
-	0x64, 0x81, 0xea, 0x84, 0x08, 0x81, 0x6d, 0x4b, 0x2d, 0xca, 0x05, 0x1b, 0xca, 0x02, 0xb7, 0x0d,
-	0x28, 0xe2, 0x24, 0x70, 0xe2, 0xa1, 0x1c, 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x80, 0xf8, 0x01,
-	0x10, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x20, 0xf5, 0xbc, 0xcf, 0x00, 0x00, 0x00,
+	0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xe8, 0x83, 0x58, 0x10, 0x49, 0x25, 0x5b, 0x2e, 0xb6,
+	0x20, 0xb0, 0x62, 0x21, 0x21, 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d,
+	0x66, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x84, 0x04, 0xb9, 0x98, 0x93, 0x8b, 0x92, 0x25, 0x98,
+	0x80, 0x42, 0xbc, 0x50, 0x21, 0x1e, 0x2e, 0x96, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x66, 0xa0, 0x18,
+	0x8f, 0x92, 0x31, 0x17, 0x47, 0x70, 0x5e, 0x62, 0x41, 0x71, 0x46, 0x7e, 0x89, 0x90, 0x30, 0x17,
+	0x6b, 0x66, 0x5e, 0x4a, 0x6a, 0x05, 0xd8, 0x04, 0x16, 0xa8, 0x72, 0x90, 0xa9, 0xa9, 0x45, 0xb9,
+	0x60, 0x23, 0xa0, 0x62, 0x4e, 0x02, 0x27, 0x1e, 0xca, 0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0x01,
+	0x88, 0x1f, 0x00, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x73, 0xbe, 0x84, 0x03, 0xb1, 0x00, 0x00,
+	0x00,
 }
 }