diff --git a/Documentation/rfc/v3api.proto b/Documentation/rfc/v3api.proto index af6ad4b0d2a..d40d421c5d3 100644 --- a/Documentation/rfc/v3api.proto +++ b/Documentation/rfc/v3api.proto @@ -3,9 +3,12 @@ syntax = "proto3"; // Interface exported by the server. service etcd { // Range gets the keys in the range from the store. - // Maybe rename it to GET? rpc Range(RangeRequest) returns (RangeResponse) {} + // ConsistentRange gets the keys in the range from the store consistently across + // multiple requests. Only etcd leader can serve ConsistentRangeRequest. + rpc ConsistentRange(ConsistentRangeRequest) returns (ConsistentRangeResponse) {} + // Put puts the given key into the store. // A put request increases the index of the store, // and generates one event in the event history. @@ -75,24 +78,28 @@ message RangeRequest { optional bytes range_end = 2; // limit the number of keys returned. optional int64 limit = 3; - // if not all the keys are returned, a continue id will be - // returned in the range response if consistent is set. - // the returned continue id only works with the previous - // etcdserver the client connected to. - optional bool consistent = 4 - // continue the previous range request in a consistent - // manner if a continue id is provided. - optional int64 continue_id = 5; } message RangeResponse { optional ResponseHeader header = 1; repeated KeyValue kvs = 2; - optional continue_id = 3; - // the next range request with continue_id must - // be issued with in continue_timeout to the - // same server. - optional continue_timeout = 4; +} + +message ConsistentRangeRequest { + optional RangeRequest request = 1; + // the result is consistent with previous request with same token if the token is + // given and is vaild. + // if the token is not given, a consistent token will be returned in the response + // for future use. + optional int64 consistent_token = 2; +} + +message ConsistentRangeResponse { + optional RangeResponse response = 1; + optional consistent_token = 2; + // the next range request with consistent_token must + // be issued with in timeout + optional int64 timeout = 3; } message PutRequest {