diff --git a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json index dd12cf315cc7..bfe44808defc 100644 --- a/Documentation/dev-guide/apispec/swagger/rpc.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/rpc.swagger.json @@ -36,7 +36,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -69,7 +69,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -102,7 +102,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -135,7 +135,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -168,7 +168,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -201,7 +201,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -234,7 +234,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -267,7 +267,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -300,7 +300,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -333,7 +333,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -366,7 +366,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -399,7 +399,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -432,7 +432,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -465,7 +465,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -498,7 +498,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -531,7 +531,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -564,7 +564,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -597,7 +597,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -630,7 +630,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -663,7 +663,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -696,7 +696,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -729,7 +729,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -762,7 +762,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -795,7 +795,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -828,7 +828,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -861,7 +861,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -894,7 +894,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -927,7 +927,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -960,7 +960,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -993,7 +993,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1026,7 +1026,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1069,7 +1069,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1102,7 +1102,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1135,7 +1135,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1168,7 +1168,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1201,7 +1201,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1234,7 +1234,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1267,7 +1267,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1300,7 +1300,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1342,7 +1342,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1375,7 +1375,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1408,7 +1408,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1451,7 +1451,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -1567,8 +1567,7 @@ "type": "object", "properties": { "no_password": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -1779,8 +1778,7 @@ "title": "authRevision is the current revision of auth store" }, "enabled": { - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "header": { "$ref": "#/definitions/etcdserverpbResponseHeader" @@ -1962,8 +1960,7 @@ "properties": { "physical": { "description": "physical is set so the RPC will wait until the compaction is physically\napplied to the local database such that compacted entries are totally\nremoved from the backend database.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "revision": { "description": "revision is the key-value store revision for the compaction operation.", @@ -2049,8 +2046,7 @@ }, "prev_kv": { "description": "If prev_kv is set, etcd gets the previous key-value pairs before deleting it.\nThe previous key-value pairs will be returned in the delete response.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "range_end": { "description": "range_end is the key following the last key to delete for the range [key, range_end).\nIf range_end is not given, the range is defined to contain only the key argument.\nIf range_end is one bit larger than the given key, then the range is all the keys\nwith the prefix (the given key).\nIf range_end is '\\0', the range is all keys greater than or equal to the key argument.", @@ -2266,8 +2262,7 @@ }, "keys": { "description": "keys is true to query all the keys attached to this lease.", - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2319,8 +2314,7 @@ }, "isLearner": { "description": "isLearner indicates if the member is raft learner.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "name": { "description": "name is the human-readable name of the member. If the member is not started, the name will be an empty string.", @@ -2340,8 +2334,7 @@ "properties": { "isLearner": { "description": "isLearner indicates if the added member is raft learner.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "peerURLs": { "description": "peerURLs is the list of URLs the added member will use to communicate with the cluster.", @@ -2375,8 +2368,7 @@ "type": "object", "properties": { "linearizable": { - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2500,13 +2492,11 @@ "properties": { "ignore_lease": { "description": "If ignore_lease is set, etcd updates the key using its current lease.\nReturns an error if the key does not exist.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "ignore_value": { "description": "If ignore_value is set, etcd updates the key using its current value.\nReturns an error if the key does not exist.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "key": { "description": "key is the key, in bytes, to put into the key-value store.", @@ -2520,8 +2510,7 @@ }, "prev_kv": { "description": "If prev_kv is set, etcd gets the previous key-value pair before changing it.\nThe previous key-value pair will be returned in the put response.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "value": { "description": "value is the value, in bytes, to associate with the key in the key-value store.", @@ -2547,8 +2536,7 @@ "properties": { "count_only": { "description": "count_only when set returns only the count of the keys in the range.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "key": { "description": "key is the first key for the range. If range_end is not given, the request only looks up key.", @@ -2557,8 +2545,7 @@ }, "keys_only": { "description": "keys_only when set returns only the keys and not the values.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "limit": { "description": "limit is a limit on the number of keys returned for the request. When limit is set to 0,\nit is treated as no limit.", @@ -2597,8 +2584,7 @@ }, "serializable": { "description": "serializable sets the range request to use serializable member-local reads.\nRange requests are linearizable by default; linearizable requests have higher\nlatency and lower throughput than serializable requests but reflect the current\nconsensus of the cluster. For better performance, in exchange for possible stale reads,\na serializable range request is served locally without needing to reach consensus\nwith other nodes in the cluster.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "sort_order": { "description": "sort_order is the order for returned sorted results.", @@ -2630,8 +2616,7 @@ }, "more": { "description": "more indicates if there are more keys to return in the requested range.", - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2671,7 +2656,7 @@ "format": "uint64" }, "revision": { - "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nreceived in this stream are guaranteed to have a higher revision number than the\nheader.revision number.", + "description": "revision is the key-value store revision when the request was applied, and it's\nunset (so 0) in case of calls not interacting with key-value store.\nFor watch progress responses, the header.revision indicates progress. All future events\nreceived in this stream are guaranteed to have a higher revision number than the\nheader.revision number.", "type": "string", "format": "int64" } @@ -2748,8 +2733,7 @@ }, "isLearner": { "description": "isLearner indicates if the member is raft learner.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "leader": { "description": "leader is the member ID which the responding member believes is the current leader.", @@ -2823,8 +2807,7 @@ }, "succeeded": { "description": "succeeded is set to true if the compare evaluated to true or false otherwise.", - "type": "boolean", - "format": "boolean" + "type": "boolean" } } }, @@ -2850,8 +2833,7 @@ }, "fragment": { "description": "fragment enables splitting large revisions into multiple watch responses.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "key": { "description": "key is the key to register for watching.", @@ -2860,13 +2842,11 @@ }, "prev_kv": { "description": "If prev_kv is set, created watcher gets the previous KV before the event happens.\nIf the previous KV is already compacted, nothing will be returned.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "progress_notify": { "description": "progress_notify is set so that the etcd server will periodically send a WatchResponse with\nno events to the new watcher if there are no recent events. It is useful when clients\nwish to recover a disconnected watcher starting from a recent known revision.\nThe etcd server may decide how often it will send notifications based on current load.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "range_end": { "description": "range_end is the end of the range [key, range_end) to watch. If range_end is not given,\nonly the key argument is watched. If range_end is equal to '\\0', all keys greater than\nor equal to the key argument are watched.\nIf the range_end is one bit larger than the given key,\nthen all keys with the prefix (the given key) will be watched.", @@ -2912,8 +2892,7 @@ }, "canceled": { "description": "canceled is set to true if the response is for a cancel watch request.\nNo further events will be sent to the canceled watcher.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "compact_revision": { "description": "compact_revision is set to the minimum index if a watcher tries to watch\nat a compacted index.\n\nThis happens when creating a watcher at a compacted revision or the watcher cannot\ncatch up with the progress of the key-value store.\n\nThe client should treat the watcher as canceled and should not try to create any\nwatcher with the same start_revision again.", @@ -2922,8 +2901,7 @@ }, "created": { "description": "created is set to true if the response is for a create watch request.\nThe client should record the watch_id and expect to receive events for\nthe created watcher from the same stream.\nAll events sent to the created watcher will attach with the same watch_id.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "events": { "type": "array", @@ -2933,8 +2911,7 @@ }, "fragment": { "description": "framgment is true if large watch response was split over multiple responses.", - "type": "boolean", - "format": "boolean" + "type": "boolean" }, "header": { "$ref": "#/definitions/etcdserverpbResponseHeader" diff --git a/Documentation/dev-guide/apispec/swagger/v3election.swagger.json b/Documentation/dev-guide/apispec/swagger/v3election.swagger.json index 8322e0312226..7238a44e7928 100644 --- a/Documentation/dev-guide/apispec/swagger/v3election.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/v3election.swagger.json @@ -23,7 +23,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -56,7 +56,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -98,7 +98,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -131,7 +131,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -164,7 +164,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -203,7 +203,7 @@ "revision": { "type": "string", "format": "int64", - "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nreceived in this stream are guaranteed to have a higher revision number than the\nheader.revision number." + "description": "revision is the key-value store revision when the request was applied, and it's\nunset (so 0) in case of calls not interacting with key-value store.\nFor watch progress responses, the header.revision indicates progress. All future events\nreceived in this stream are guaranteed to have a higher revision number than the\nheader.revision number." }, "raft_term": { "type": "string", diff --git a/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json b/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json index aac2bf3ec692..5a45bdd9b2a8 100644 --- a/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json +++ b/Documentation/dev-guide/apispec/swagger/v3lock.swagger.json @@ -23,7 +23,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -56,7 +56,7 @@ } }, "default": { - "description": "An unexpected error response", + "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/runtimeError" } @@ -95,7 +95,7 @@ "revision": { "type": "string", "format": "int64", - "description": "revision is the key-value store revision when the request was applied.\nFor watch progress responses, the header.revision indicates progress. All future events\nreceived in this stream are guaranteed to have a higher revision number than the\nheader.revision number." + "description": "revision is the key-value store revision when the request was applied, and it's\nunset (so 0) in case of calls not interacting with key-value store.\nFor watch progress responses, the header.revision indicates progress. All future events\nreceived in this stream are guaranteed to have a higher revision number than the\nheader.revision number." }, "raft_term": { "type": "string", diff --git a/api/etcdserverpb/gw/rpc.pb.gw.go b/api/etcdserverpb/gw/rpc.pb.gw.go index 2fca126af851..042a4bee2bda 100644 --- a/api/etcdserverpb/gw/rpc.pb.gw.go +++ b/api/etcdserverpb/gw/rpc.pb.gw.go @@ -21,6 +21,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,6 +32,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_KV_Range_0(ctx context.Context, marshaler runtime.Marshaler, client etcdserverpb.KVClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq etcdserverpb.RangeRequest @@ -1558,11 +1560,14 @@ func local_request_Auth_RoleRevokePermission_0(ctx context.Context, marshaler ru // etcdserverpb.RegisterKVHandlerServer registers the http handlers for service KV to "mux". // UnaryRPC :call etcdserverpb.KVServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterKVHandlerFromEndpoint instead. func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server etcdserverpb.KVServer) error { mux.Handle("POST", pattern_KV_Range_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1570,6 +1575,7 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return } resp, md, err := local_request_KV_Range_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1583,6 +1589,8 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server mux.Handle("POST", pattern_KV_Put_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1590,6 +1598,7 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return } resp, md, err := local_request_KV_Put_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1603,6 +1612,8 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server mux.Handle("POST", pattern_KV_DeleteRange_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1610,6 +1621,7 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return } resp, md, err := local_request_KV_DeleteRange_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1623,6 +1635,8 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server mux.Handle("POST", pattern_KV_Txn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1630,6 +1644,7 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return } resp, md, err := local_request_KV_Txn_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1643,6 +1658,8 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server mux.Handle("POST", pattern_KV_Compact_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1650,6 +1667,7 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return } resp, md, err := local_request_KV_Compact_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1666,6 +1684,7 @@ func RegisterKVHandlerServer(ctx context.Context, mux *runtime.ServeMux, server // etcdserverpb.RegisterWatchHandlerServer registers the http handlers for service Watch to "mux". // UnaryRPC :call etcdserverpb.WatchServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWatchHandlerFromEndpoint instead. func RegisterWatchHandlerServer(ctx context.Context, mux *runtime.ServeMux, server etcdserverpb.WatchServer) error { mux.Handle("POST", pattern_Watch_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -1681,11 +1700,14 @@ func RegisterWatchHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv // etcdserverpb.RegisterLeaseHandlerServer registers the http handlers for service Lease to "mux". // UnaryRPC :call etcdserverpb.LeaseServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLeaseHandlerFromEndpoint instead. func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, server etcdserverpb.LeaseServer) error { mux.Handle("POST", pattern_Lease_LeaseGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1693,6 +1715,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseGrant_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1706,6 +1729,8 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Lease_LeaseRevoke_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1713,6 +1738,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseRevoke_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1726,6 +1752,8 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Lease_LeaseRevoke_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1733,6 +1761,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseRevoke_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1753,6 +1782,8 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Lease_LeaseTimeToLive_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1760,6 +1791,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseTimeToLive_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1773,6 +1805,8 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Lease_LeaseTimeToLive_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1780,6 +1814,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseTimeToLive_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1793,6 +1828,8 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Lease_LeaseLeases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1800,6 +1837,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseLeases_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1813,6 +1851,8 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("POST", pattern_Lease_LeaseLeases_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1820,6 +1860,7 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Lease_LeaseLeases_1(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1836,11 +1877,14 @@ func RegisterLeaseHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv // etcdserverpb.RegisterClusterHandlerServer registers the http handlers for service Cluster to "mux". // UnaryRPC :call etcdserverpb.ClusterServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterClusterHandlerFromEndpoint instead. func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server etcdserverpb.ClusterServer) error { mux.Handle("POST", pattern_Cluster_MemberAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1848,6 +1892,7 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se return } resp, md, err := local_request_Cluster_MemberAdd_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1861,6 +1906,8 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se mux.Handle("POST", pattern_Cluster_MemberRemove_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1868,6 +1915,7 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se return } resp, md, err := local_request_Cluster_MemberRemove_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1881,6 +1929,8 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se mux.Handle("POST", pattern_Cluster_MemberUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1888,6 +1938,7 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se return } resp, md, err := local_request_Cluster_MemberUpdate_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1901,6 +1952,8 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se mux.Handle("POST", pattern_Cluster_MemberList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1908,6 +1961,7 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se return } resp, md, err := local_request_Cluster_MemberList_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1921,6 +1975,8 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se mux.Handle("POST", pattern_Cluster_MemberPromote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1928,6 +1984,7 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se return } resp, md, err := local_request_Cluster_MemberPromote_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1944,11 +2001,14 @@ func RegisterClusterHandlerServer(ctx context.Context, mux *runtime.ServeMux, se // etcdserverpb.RegisterMaintenanceHandlerServer registers the http handlers for service Maintenance to "mux". // UnaryRPC :call etcdserverpb.MaintenanceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMaintenanceHandlerFromEndpoint instead. func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server etcdserverpb.MaintenanceServer) error { mux.Handle("POST", pattern_Maintenance_Alarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1956,6 +2016,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_Alarm_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1969,6 +2030,8 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_Maintenance_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1976,6 +2039,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_Status_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1989,6 +2053,8 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_Maintenance_Defragment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1996,6 +2062,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_Defragment_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2009,6 +2076,8 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_Maintenance_Hash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2016,6 +2085,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_Hash_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2029,6 +2099,8 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_Maintenance_HashKV_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2036,6 +2108,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_HashKV_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2056,6 +2129,8 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_Maintenance_MoveLeader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2063,6 +2138,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_MoveLeader_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2076,6 +2152,8 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_Maintenance_Downgrade_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2083,6 +2161,7 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_Maintenance_Downgrade_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2099,11 +2178,14 @@ func RegisterMaintenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux // etcdserverpb.RegisterAuthHandlerServer registers the http handlers for service Auth to "mux". // UnaryRPC :call etcdserverpb.AuthServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthHandlerFromEndpoint instead. func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server etcdserverpb.AuthServer) error { mux.Handle("POST", pattern_Auth_AuthEnable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2111,6 +2193,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_AuthEnable_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2124,6 +2207,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_AuthDisable_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2131,6 +2216,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_AuthDisable_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2144,6 +2230,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_AuthStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2151,6 +2239,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_AuthStatus_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2164,6 +2253,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2171,6 +2262,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_Authenticate_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2184,6 +2276,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2191,6 +2285,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserAdd_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2204,6 +2299,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserGet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2211,6 +2308,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserGet_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2224,6 +2322,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2231,6 +2331,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserList_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2244,6 +2345,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2251,6 +2354,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserDelete_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2264,6 +2368,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2271,6 +2377,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserChangePassword_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2284,6 +2391,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserGrantRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2291,6 +2400,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserGrantRole_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2304,6 +2414,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_UserRevokeRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2311,6 +2423,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_UserRevokeRole_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2324,6 +2437,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_RoleAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2331,6 +2446,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_RoleAdd_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2344,6 +2460,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_RoleGet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2351,6 +2469,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_RoleGet_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2364,6 +2483,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_RoleList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2371,6 +2492,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_RoleList_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2384,6 +2506,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_RoleDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2391,6 +2515,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_RoleDelete_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2404,6 +2529,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_RoleGrantPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2411,6 +2538,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_RoleGrantPermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -2424,6 +2552,8 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Auth_RoleRevokePermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -2431,6 +2561,7 @@ func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Auth_RoleRevokePermission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/api/etcdserverpb/raft_internal.pb.go b/api/etcdserverpb/raft_internal.pb.go index d59e65813f4f..c7ef10644ee9 100644 --- a/api/etcdserverpb/raft_internal.pb.go +++ b/api/etcdserverpb/raft_internal.pb.go @@ -85,6 +85,7 @@ type InternalRaftRequest struct { LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke,proto3" json:"lease_revoke,omitempty"` Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm,proto3" json:"alarm,omitempty"` LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint,proto3" json:"lease_checkpoint,omitempty"` + LeaseRenew *LeaseKeepAliveRequest `protobuf:"bytes,12,opt,name=lease_renew,json=leaseRenew,proto3" json:"lease_renew,omitempty"` AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable,proto3" json:"auth_enable,omitempty"` AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable,proto3" json:"auth_disable,omitempty"` AuthStatus *AuthStatusRequest `protobuf:"bytes,1013,opt,name=auth_status,json=authStatus,proto3" json:"auth_status,omitempty"` @@ -238,73 +239,75 @@ func init() { func init() { proto.RegisterFile("raft_internal.proto", fileDescriptor_b4c9a9be0cfca103) } var fileDescriptor_b4c9a9be0cfca103 = []byte{ - // 1054 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x56, 0x5d, 0x6f, 0x1b, 0x45, - 0x14, 0xad, 0xd3, 0x34, 0x89, 0xc7, 0x49, 0x9a, 0x4e, 0x52, 0x3a, 0x38, 0x92, 0x71, 0x03, 0x2d, - 0x01, 0x8a, 0x53, 0x1c, 0x78, 0xe1, 0x05, 0x5c, 0x3b, 0x4a, 0x83, 0x4a, 0x15, 0x6d, 0x0b, 0xaa, - 0x84, 0xd0, 0x32, 0xde, 0xbd, 0xb1, 0xb7, 0x59, 0xef, 0x2e, 0x33, 0x63, 0x37, 0x7d, 0xe5, 0x91, - 0x67, 0x40, 0xfc, 0x0c, 0x3e, 0xff, 0x43, 0x85, 0xf8, 0x28, 0xf0, 0x07, 0x20, 0xbc, 0xf0, 0x0e, - 0xbc, 0xa3, 0xf9, 0xd8, 0x5d, 0xaf, 0x3d, 0xce, 0xdb, 0xfa, 0xde, 0x73, 0xcf, 0x39, 0x33, 0x73, - 0xef, 0x78, 0xd0, 0x3a, 0xa3, 0x47, 0xc2, 0x0d, 0x22, 0x01, 0x2c, 0xa2, 0x61, 0x23, 0x61, 0xb1, - 0x88, 0xf1, 0x32, 0x08, 0xcf, 0xe7, 0xc0, 0x46, 0xc0, 0x92, 0x6e, 0x75, 0xa3, 0x17, 0xf7, 0x62, - 0x95, 0xd8, 0x91, 0x5f, 0x1a, 0x53, 0x5d, 0xcb, 0x31, 0x26, 0x52, 0x66, 0x89, 0x67, 0x3e, 0xeb, - 0x32, 0xb9, 0x43, 0x93, 0x60, 0x67, 0x04, 0x8c, 0x07, 0x71, 0x94, 0x74, 0xd3, 0x2f, 0x83, 0xb8, - 0x9e, 0x21, 0x06, 0x30, 0xe8, 0x02, 0xe3, 0xfd, 0x20, 0x49, 0xba, 0x63, 0x3f, 0x34, 0x6e, 0x8b, - 0xa1, 0x15, 0x07, 0x3e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26, 0x05, 0xc5, 0x49, 0x44, 0x16, 0x6c, 0x82, - 0xf7, 0x4f, 0xa2, 0x4c, 0x50, 0x9c, 0x44, 0xf8, 0x2d, 0x84, 0xbc, 0x78, 0x90, 0x50, 0x4f, 0xc8, - 0x63, 0x58, 0x54, 0x25, 0xcf, 0x15, 0x4b, 0xda, 0x59, 0x3e, 0xad, 0x1c, 0x2b, 0xc1, 0x6f, 0xa3, - 0x4a, 0x08, 0x94, 0x83, 0xdb, 0x63, 0x34, 0x12, 0x64, 0xc9, 0xc6, 0x70, 0x47, 0x02, 0xf6, 0x65, - 0x3e, 0x63, 0x08, 0xb3, 0x90, 0x5c, 0xb3, 0x66, 0x60, 0x30, 0x8a, 0x8f, 0x81, 0x94, 0x6d, 0x6b, - 0x56, 0x14, 0x8e, 0x02, 0x64, 0x6b, 0x0e, 0xf3, 0x98, 0x3c, 0x16, 0x1a, 0x52, 0x36, 0x20, 0xc8, - 0x76, 0x2c, 0x2d, 0x99, 0xca, 0x8e, 0x45, 0x01, 0xf1, 0x03, 0xb4, 0xa6, 0x65, 0xbd, 0x3e, 0x78, - 0xc7, 0x49, 0x1c, 0x44, 0x82, 0x54, 0x54, 0xf1, 0x0b, 0x16, 0xe9, 0x76, 0x06, 0x32, 0x34, 0x69, - 0xb3, 0xbe, 0xee, 0x5c, 0x0c, 0x8b, 0x00, 0xdc, 0x42, 0x15, 0xd5, 0xdd, 0x10, 0xd1, 0x6e, 0x08, - 0xe4, 0x6f, 0xeb, 0xae, 0xb6, 0x86, 0xa2, 0xbf, 0xa7, 0x00, 0xd9, 0x9e, 0xd0, 0x2c, 0x84, 0x3b, - 0x48, 0x8d, 0x80, 0xeb, 0x07, 0x5c, 0x71, 0xfc, 0xb3, 0x68, 0xdb, 0x14, 0xc9, 0xd1, 0xd1, 0x88, - 0x6c, 0x53, 0x68, 0x1e, 0xc3, 0xef, 0x18, 0x23, 0x5c, 0x50, 0x31, 0xe4, 0xe4, 0xbf, 0x99, 0x46, - 0xee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1, 0x96, 0x10, 0xcc, 0x26, 0xb4, - 0xe1, 0x59, 0x50, 0xf8, 0x43, 0x84, 0xfd, 0xf8, 0x51, 0xd4, 0x63, 0xd4, 0x07, 0x37, 0x88, 0x8e, - 0x62, 0x25, 0xf3, 0x85, 0x96, 0xb9, 0x56, 0x94, 0xe9, 0xa4, 0xc0, 0x83, 0xe8, 0x28, 0xb6, 0x49, - 0xac, 0xf9, 0x13, 0x88, 0xfc, 0x31, 0x75, 0x11, 0xad, 0xec, 0x0d, 0x12, 0xf1, 0xd8, 0x01, 0x9e, - 0xc4, 0x11, 0x87, 0xad, 0xc7, 0x68, 0xf3, 0x8c, 0xeb, 0x1b, 0x63, 0x34, 0xaf, 0xde, 0x72, 0x25, - 0xf5, 0x96, 0x53, 0xdf, 0xf2, 0x8d, 0x97, 0xdd, 0x6a, 0xe6, 0x8d, 0x97, 0xfe, 0xc6, 0x57, 0xd1, - 0x32, 0x0f, 0x06, 0x49, 0x08, 0xae, 0x88, 0x8f, 0x41, 0x3f, 0xf1, 0xca, 0x4e, 0x45, 0xc7, 0xee, - 0xcb, 0x50, 0xe6, 0xe5, 0xd6, 0xc6, 0x93, 0x3f, 0x6b, 0xe7, 0x9e, 0x9c, 0xd6, 0x4a, 0x4f, 0x4f, - 0x6b, 0xa5, 0x3f, 0x4e, 0x6b, 0xa5, 0x2f, 0xff, 0xaa, 0x9d, 0xeb, 0x2e, 0xa8, 0x97, 0xe6, 0xee, - 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x30, 0x36, 0x53, 0xc6, 0x0b, 0x0b, 0x00, 0x00, + // 1083 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x56, 0x4d, 0x73, 0x1b, 0x45, + 0x10, 0x8d, 0x6c, 0xc7, 0xb6, 0x46, 0xb6, 0xe3, 0x8c, 0x1d, 0x32, 0xd8, 0x55, 0x46, 0x31, 0x24, + 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, 0xfb, 0xf1, 0x71, 0xd4, 0x61, 0xd4, 0x07, 0x37, 0x88, 0x0e, 0x63, 0x25, 0xf3, + 0xa5, 0x96, 0xb9, 0x5a, 0x94, 0x69, 0xa5, 0xc0, 0xfd, 0xe8, 0x30, 0xb6, 0x49, 0x2c, 0xfb, 0x23, + 0x88, 0xfc, 0x6d, 0x76, 0x01, 0x2d, 0xee, 0xf6, 0x12, 0xf1, 0xc8, 0x01, 0x9e, 0xc4, 0x11, 0x87, + 0xcd, 0x47, 0x68, 0xfd, 0x8c, 0xeb, 0x1b, 0x63, 0x34, 0xa3, 0x9e, 0x86, 0x25, 0xf5, 0x34, 0x54, + 0xdf, 0xf2, 0xc9, 0x98, 0xdd, 0x6a, 0xe6, 0xc9, 0x98, 0xfe, 0xc6, 0x57, 0xd0, 0x02, 0x0f, 0x7a, + 0x49, 0x08, 0xae, 0x88, 0x8f, 0x40, 0xbf, 0x18, 0xcb, 0x4e, 0x45, 0xc7, 0xee, 0xcb, 0x50, 0xe6, + 0xe5, 0xe6, 0xea, 0xe3, 0xbf, 0x36, 0xce, 0x3d, 0x3e, 0xdd, 0x28, 0x3d, 0x39, 0xdd, 0x28, 0xfd, + 0x79, 0xba, 0x51, 0xfa, 0xea, 0xef, 0x8d, 0x73, 0xed, 0x59, 0xf5, 0x70, 0xdd, 0x79, 0x1a, 0x00, + 0x00, 0xff, 0xff, 0x51, 0x34, 0x24, 0xd0, 0x5a, 0x0b, 0x00, 0x00, } func (m *RequestHeader) Marshal() (dAtA []byte, err error) { @@ -669,6 +672,18 @@ func (m *InternalRaftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0xa2 } + if m.LeaseRenew != nil { + { + size, err := m.LeaseRenew.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRaftInternal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } if m.LeaseCheckpoint != nil { { size, err := m.LeaseCheckpoint.MarshalToSizedBuffer(dAtA[:i]) @@ -954,6 +969,10 @@ func (m *InternalRaftRequest) Size() (n int) { l = m.LeaseCheckpoint.Size() n += 1 + l + sovRaftInternal(uint64(l)) } + if m.LeaseRenew != nil { + l = m.LeaseRenew.Size() + n += 1 + l + sovRaftInternal(uint64(l)) + } if m.Header != nil { l = m.Header.Size() n += 2 + l + sovRaftInternal(uint64(l)) @@ -1615,6 +1634,42 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LeaseRenew", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRaftInternal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LeaseRenew == nil { + m.LeaseRenew = &LeaseKeepAliveRequest{} + } + if err := m.LeaseRenew.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 100: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) diff --git a/api/etcdserverpb/raft_internal.proto b/api/etcdserverpb/raft_internal.proto index f1036b9f6194..f457c90ab2a8 100644 --- a/api/etcdserverpb/raft_internal.proto +++ b/api/etcdserverpb/raft_internal.proto @@ -44,6 +44,7 @@ message InternalRaftRequest { AlarmRequest alarm = 10; LeaseCheckpointRequest lease_checkpoint = 11 [(versionpb.etcd_version_field) = "3.4"]; + LeaseKeepAliveRequest lease_renew = 12 [(versionpb.etcd_version_field) = "3.6"]; AuthEnableRequest auth_enable = 1000; AuthDisableRequest auth_disable = 1011; diff --git a/scripts/etcd_version_annotations.txt b/scripts/etcd_version_annotations.txt index 17b587cf6271..908aca66d9ae 100644 --- a/scripts/etcd_version_annotations.txt +++ b/scripts/etcd_version_annotations.txt @@ -203,6 +203,7 @@ etcdserverpb.InternalRaftRequest.downgrade_info_set: "3.5" etcdserverpb.InternalRaftRequest.header: "" etcdserverpb.InternalRaftRequest.lease_checkpoint: "3.4" etcdserverpb.InternalRaftRequest.lease_grant: "" +etcdserverpb.InternalRaftRequest.lease_renew: "3.6" etcdserverpb.InternalRaftRequest.lease_revoke: "" etcdserverpb.InternalRaftRequest.put: "" etcdserverpb.InternalRaftRequest.range: "" diff --git a/server/etcdserver/api/etcdhttp/peer.go b/server/etcdserver/api/etcdhttp/peer.go index a205eca65c4d..51a13556c0dc 100644 --- a/server/etcdserver/api/etcdhttp/peer.go +++ b/server/etcdserver/api/etcdhttp/peer.go @@ -63,7 +63,6 @@ func newPeerHandler( mux.Handle(peerMembersPath, peerMembersHandler) mux.Handle(peerMemberPromotePrefix, peerMemberPromoteHandler) if leaseHandler != nil { - mux.Handle(leasehttp.LeasePrefix, leaseHandler) mux.Handle(leasehttp.LeaseInternalPrefix, leaseHandler) } if downgradeEnabledHandler != nil { diff --git a/server/etcdserver/api/v3election/v3electionpb/gw/v3election.pb.gw.go b/server/etcdserver/api/v3election/v3electionpb/gw/v3election.pb.gw.go index 4a6e5e724cc8..432fb9c4477d 100644 --- a/server/etcdserver/api/v3election/v3electionpb/gw/v3election.pb.gw.go +++ b/server/etcdserver/api/v3election/v3electionpb/gw/v3election.pb.gw.go @@ -21,6 +21,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,6 +32,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Election_Campaign_0(ctx context.Context, marshaler runtime.Marshaler, client v3electionpb.ElectionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq v3electionpb.CampaignRequest @@ -196,11 +198,14 @@ func local_request_Election_Resign_0(ctx context.Context, marshaler runtime.Mars // v3electionpb.RegisterElectionHandlerServer registers the http handlers for service Election to "mux". // UnaryRPC :call v3electionpb.ElectionServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterElectionHandlerFromEndpoint instead. func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server v3electionpb.ElectionServer) error { mux.Handle("POST", pattern_Election_Campaign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -208,6 +213,7 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s return } resp, md, err := local_request_Election_Campaign_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -221,6 +227,8 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s mux.Handle("POST", pattern_Election_Proclaim_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -228,6 +236,7 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s return } resp, md, err := local_request_Election_Proclaim_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -241,6 +250,8 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s mux.Handle("POST", pattern_Election_Leader_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -248,6 +259,7 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s return } resp, md, err := local_request_Election_Leader_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -268,6 +280,8 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s mux.Handle("POST", pattern_Election_Resign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -275,6 +289,7 @@ func RegisterElectionHandlerServer(ctx context.Context, mux *runtime.ServeMux, s return } resp, md, err := local_request_Election_Resign_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/server/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go b/server/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go index dc573d79cf0f..27be5acc5582 100644 --- a/server/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go +++ b/server/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go @@ -21,6 +21,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,6 +32,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Lock_Lock_0(ctx context.Context, marshaler runtime.Marshaler, client v3lockpb.LockClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq v3lockpb.LockRequest @@ -103,11 +105,14 @@ func local_request_Lock_Unlock_0(ctx context.Context, marshaler runtime.Marshale // v3lockpb.RegisterLockHandlerServer registers the http handlers for service Lock to "mux". // UnaryRPC :call v3lockpb.LockServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLockHandlerFromEndpoint instead. func RegisterLockHandlerServer(ctx context.Context, mux *runtime.ServeMux, server v3lockpb.LockServer) error { mux.Handle("POST", pattern_Lock_Lock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -115,6 +120,7 @@ func RegisterLockHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Lock_Lock_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -128,6 +134,8 @@ func RegisterLockHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve mux.Handle("POST", pattern_Lock_Unlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -135,6 +143,7 @@ func RegisterLockHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve return } resp, md, err := local_request_Lock_Unlock_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/server/etcdserver/api/v3rpc/lease.go b/server/etcdserver/api/v3rpc/lease.go index e123dd2a37ca..d66b95318428 100644 --- a/server/etcdserver/api/v3rpc/lease.go +++ b/server/etcdserver/api/v3rpc/lease.go @@ -129,20 +129,21 @@ func (ls *LeaseServer) leaseKeepAlive(stream pb.Lease_LeaseKeepAliveServer) erro // or remote leader. // Without this, a lease might be revoked at rev 3 but client can see the keepalive succeeded // at rev 4. - resp := &pb.LeaseKeepAliveResponse{ID: req.ID, Header: &pb.ResponseHeader{}} - ls.hdr.fill(resp.Header) + // todo(ahrtr): remove respForLeaseNotFound, we don't need to ErrLeaseNotFound separately. + respForLeaseNotFound := &pb.LeaseKeepAliveResponse{ID: req.ID, Header: &pb.ResponseHeader{}} + ls.hdr.fill(respForLeaseNotFound.Header) - ttl, err := ls.le.LeaseRenew(stream.Context(), lease.LeaseID(req.ID)) + resp, err := ls.le.LeaseRenew(stream.Context(), req) if err == lease.ErrLeaseNotFound { err = nil - ttl = 0 + respForLeaseNotFound.TTL = 0 + resp = respForLeaseNotFound } if err != nil { return togRPCError(err) } - resp.TTL = ttl err = stream.Send(resp) if err != nil { if isClientCtxErr(stream.Context().Err(), err) { diff --git a/server/etcdserver/apply/apply.go b/server/etcdserver/apply/apply.go index 9fe77e91f4c7..d6e8c4363ee1 100644 --- a/server/etcdserver/apply/apply.go +++ b/server/etcdserver/apply/apply.go @@ -78,6 +78,7 @@ type applierV3 interface { LeaseGrant(lc *pb.LeaseGrantRequest) (*pb.LeaseGrantResponse, error) LeaseRevoke(lc *pb.LeaseRevokeRequest) (*pb.LeaseRevokeResponse, error) + LeaseRenew(lc *pb.LeaseKeepAliveRequest) (*pb.LeaseKeepAliveResponse, error) LeaseCheckpoint(lc *pb.LeaseCheckpointRequest) (*pb.LeaseCheckpointResponse, error) @@ -206,6 +207,11 @@ func (a *applierV3backend) LeaseRevoke(lc *pb.LeaseRevokeRequest) (*pb.LeaseRevo return &pb.LeaseRevokeResponse{Header: a.newHeader()}, err } +func (a *applierV3backend) LeaseRenew(lc *pb.LeaseKeepAliveRequest) (*pb.LeaseKeepAliveResponse, error) { + ttl, err := a.lessor.Renew(lease.LeaseID(lc.ID)) + return &pb.LeaseKeepAliveResponse{Header: a.newHeader(), ID: lc.ID, TTL: ttl}, err +} + func (a *applierV3backend) LeaseCheckpoint(lc *pb.LeaseCheckpointRequest) (*pb.LeaseCheckpointResponse, error) { for _, c := range lc.Checkpoints { err := a.lessor.Checkpoint(lease.LeaseID(c.ID), c.Remaining_TTL) diff --git a/server/etcdserver/apply/corrupt.go b/server/etcdserver/apply/corrupt.go index 040f294aebad..f81836701eab 100644 --- a/server/etcdserver/apply/corrupt.go +++ b/server/etcdserver/apply/corrupt.go @@ -56,3 +56,7 @@ func (a *applierV3Corrupt) LeaseGrant(_ *pb.LeaseGrantRequest) (*pb.LeaseGrantRe func (a *applierV3Corrupt) LeaseRevoke(_ *pb.LeaseRevokeRequest) (*pb.LeaseRevokeResponse, error) { return nil, errors.ErrCorrupt } + +func (a *applierV3Corrupt) LeaseRenew(lc *pb.LeaseKeepAliveRequest) (*pb.LeaseKeepAliveResponse, error) { + return nil, errors.ErrCorrupt +} diff --git a/server/etcdserver/apply/uber_applier.go b/server/etcdserver/apply/uber_applier.go index 50f8ba4b15eb..5e5c035b0128 100644 --- a/server/etcdserver/apply/uber_applier.go +++ b/server/etcdserver/apply/uber_applier.go @@ -174,6 +174,9 @@ func (a *uberApplier) dispatch(ctx context.Context, r *pb.InternalRaftRequest, s case r.LeaseCheckpoint != nil: op = "LeaseCheckpoint" ar.Resp, ar.Err = a.applyV3.LeaseCheckpoint(r.LeaseCheckpoint) + case r.LeaseRenew != nil: + op = "LeaseRenew" + ar.Resp, ar.Err = a.applyV3.LeaseRenew(r.LeaseRenew) case r.Alarm != nil: op = "Alarm" ar.Resp, ar.Err = a.Alarm(r.Alarm) diff --git a/server/etcdserver/v3_server.go b/server/etcdserver/v3_server.go index 63a190e6ed69..b8d31885b651 100644 --- a/server/etcdserver/v3_server.go +++ b/server/etcdserver/v3_server.go @@ -68,9 +68,8 @@ type Lessor interface { // LeaseRevoke sends LeaseRevoke request to raft and toApply it after committed. LeaseRevoke(ctx context.Context, r *pb.LeaseRevokeRequest) (*pb.LeaseRevokeResponse, error) - // LeaseRenew renews the lease with given ID. The renewed TTL is returned. Or an error - // is returned. - LeaseRenew(ctx context.Context, id lease.LeaseID) (int64, error) + // LeaseRenew renews the lease. + LeaseRenew(ctx context.Context, r *pb.LeaseKeepAliveRequest) (*pb.LeaseKeepAliveResponse, error) // LeaseTimeToLive retrieves lease information. LeaseTimeToLive(ctx context.Context, r *pb.LeaseTimeToLiveRequest) (*pb.LeaseTimeToLiveResponse, error) @@ -276,45 +275,12 @@ func (s *EtcdServer) LeaseRevoke(ctx context.Context, r *pb.LeaseRevokeRequest) return resp.(*pb.LeaseRevokeResponse), nil } -func (s *EtcdServer) LeaseRenew(ctx context.Context, id lease.LeaseID) (int64, error) { - if s.isLeader() { - if err := s.waitAppliedIndex(); err != nil { - return 0, err - } - - ttl, err := s.lessor.Renew(id) - if err == nil { // already requested to primary lessor(leader) - return ttl, nil - } - if err != lease.ErrNotPrimary { - return -1, err - } - } - - cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout()) - defer cancel() - - // renewals don't go through raft; forward to leader manually - for cctx.Err() == nil { - leader, lerr := s.waitLeader(cctx) - if lerr != nil { - return -1, lerr - } - for _, url := range leader.PeerURLs { - lurl := url + leasehttp.LeasePrefix - ttl, err := leasehttp.RenewHTTP(cctx, id, lurl, s.peerRt) - if err == nil || err == lease.ErrLeaseNotFound { - return ttl, err - } - } - // Throttle in case of e.g. connection problems. - time.Sleep(50 * time.Millisecond) - } - - if cctx.Err() == context.DeadlineExceeded { - return -1, errors.ErrTimeout +func (s *EtcdServer) LeaseRenew(ctx context.Context, r *pb.LeaseKeepAliveRequest) (*pb.LeaseKeepAliveResponse, error) { + resp, err := s.raftRequestOnce(ctx, pb.InternalRaftRequest{LeaseRenew: r}) + if err != nil { + return nil, err } - return -1, errors.ErrCanceled + return resp.(*pb.LeaseKeepAliveResponse), err } func (s *EtcdServer) LeaseTimeToLive(ctx context.Context, r *pb.LeaseTimeToLiveRequest) (*pb.LeaseTimeToLiveResponse, error) { diff --git a/server/lease/leasehttp/http.go b/server/lease/leasehttp/http.go index 542c3a82a0cb..e2571f609348 100644 --- a/server/lease/leasehttp/http.go +++ b/server/lease/leasehttp/http.go @@ -61,36 +61,6 @@ func (h *leaseHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { var v []byte switch r.URL.Path { - case LeasePrefix: - lreq := pb.LeaseKeepAliveRequest{} - if uerr := lreq.Unmarshal(b); uerr != nil { - http.Error(w, "error unmarshalling request", http.StatusBadRequest) - return - } - select { - case <-h.waitch(): - case <-time.After(applyTimeout): - http.Error(w, ErrLeaseHTTPTimeout.Error(), http.StatusRequestTimeout) - return - } - ttl, rerr := h.l.Renew(lease.LeaseID(lreq.ID)) - if rerr != nil { - if rerr == lease.ErrLeaseNotFound { - http.Error(w, rerr.Error(), http.StatusNotFound) - return - } - - http.Error(w, rerr.Error(), http.StatusBadRequest) - return - } - // TODO: fill out ResponseHeader - resp := &pb.LeaseKeepAliveResponse{ID: lreq.ID, TTL: ttl} - v, err = resp.Marshal() - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - case LeaseInternalPrefix: lreq := leasepb.LeaseInternalRequest{} if lerr := lreq.Unmarshal(b); lerr != nil { diff --git a/server/lease/leasehttp/http_test.go b/server/lease/leasehttp/http_test.go index e614b4033a37..839b208d895e 100644 --- a/server/lease/leasehttp/http_test.go +++ b/server/lease/leasehttp/http_test.go @@ -26,30 +26,6 @@ import ( "go.uber.org/zap/zaptest" ) -func TestRenewHTTP(t *testing.T) { - lg := zaptest.NewLogger(t) - be, _ := betesting.NewTmpBackend(t, time.Hour, 10000) - defer betesting.Close(t, be) - - le := lease.NewLessor(lg, be, nil, lease.LessorConfig{MinLeaseTTL: int64(5)}) - le.Promote(time.Second) - l, err := le.Grant(1, int64(5)) - if err != nil { - t.Fatalf("failed to create lease: %v", err) - } - - ts := httptest.NewServer(NewHandler(le, waitReady)) - defer ts.Close() - - ttl, err := RenewHTTP(context.TODO(), l.ID, ts.URL+LeasePrefix, http.DefaultTransport) - if err != nil { - t.Fatal(err) - } - if ttl != 5 { - t.Fatalf("ttl expected 5, got %d", ttl) - } -} - func TestTimeToLiveHTTP(t *testing.T) { lg := zaptest.NewLogger(t) be, _ := betesting.NewTmpBackend(t, time.Hour, 10000) @@ -77,13 +53,6 @@ func TestTimeToLiveHTTP(t *testing.T) { } } -func TestRenewHTTPTimeout(t *testing.T) { - testApplyTimeout(t, func(l *lease.Lease, serverURL string) error { - _, err := RenewHTTP(context.TODO(), l.ID, serverURL+LeasePrefix, http.DefaultTransport) - return err - }) -} - func TestTimeToLiveHTTPTimeout(t *testing.T) { testApplyTimeout(t, func(l *lease.Lease, serverURL string) error { _, err := TimeToLiveHTTP(context.TODO(), l.ID, true, serverURL+LeaseInternalPrefix, http.DefaultTransport) diff --git a/server/lease/lessor.go b/server/lease/lessor.go index 78ed1472edd6..75720f8b32c0 100644 --- a/server/lease/lessor.go +++ b/server/lease/lessor.go @@ -286,6 +286,10 @@ func (le *lessor) Grant(id LeaseID, ttl int64) (*Lease, error) { revokec: make(chan struct{}), } + if l.ttl < le.minLeaseTTL { + l.ttl = le.minLeaseTTL + } + le.mu.Lock() defer le.mu.Unlock() @@ -293,10 +297,6 @@ func (le *lessor) Grant(id LeaseID, ttl int64) (*Lease, error) { return nil, ErrLeaseExists } - if l.ttl < le.minLeaseTTL { - l.ttl = le.minLeaseTTL - } - if le.isPrimary() { l.refresh(0) } else { @@ -326,6 +326,12 @@ func (le *lessor) Revoke(id LeaseID) error { le.mu.Unlock() return ErrLeaseNotFound } + + // We shouldn't delete the lease inside the transaction lock, otherwise + // it may lead to deadlock with Grant or Checkpoint operations, which + // acquire the le.mu firstly and then the batchTx lock. + delete(le.leaseMap, id) + defer close(l.revokec) // unlock before doing external work le.mu.Unlock() @@ -344,9 +350,6 @@ func (le *lessor) Revoke(id LeaseID) error { txn.DeleteRange([]byte(key), nil) } - le.mu.Lock() - defer le.mu.Unlock() - delete(le.leaseMap, l.ID) // lease deletion needs to be in the same backend transaction with the // kv deletion. Or we might end up with not executing the revoke or not // deleting the keys if etcdserver fails in between. @@ -362,6 +365,10 @@ func (le *lessor) Checkpoint(id LeaseID, remainingTTL int64) error { le.mu.Lock() defer le.mu.Unlock() + return le.checkpoint(id, remainingTTL) +} + +func (le *lessor) checkpoint(id LeaseID, remainingTTL int64) error { if l, ok := le.leaseMap[id]; ok { // when checkpointing, we only update the remainingTTL, Promote is responsible for applying this to lease expiry l.remainingTTL = remainingTTL @@ -388,52 +395,25 @@ func greaterOrEqual(first, second semver.Version) bool { // Renew renews an existing lease. If the given lease does not exist or // has expired, an error will be returned. func (le *lessor) Renew(id LeaseID) (int64, error) { - le.mu.RLock() - if !le.isPrimary() { - // forward renew request to primary instead of returning error. - le.mu.RUnlock() - return -1, ErrNotPrimary - } - - demotec := le.demotec + le.mu.Lock() + defer le.mu.Unlock() l := le.leaseMap[id] if l == nil { - le.mu.RUnlock() return -1, ErrLeaseNotFound } - // Clear remaining TTL when we renew if it is set - clearRemainingTTL := le.cp != nil && l.remainingTTL > 0 - le.mu.RUnlock() - if l.expired() { - select { - // A expired lease might be pending for revoking or going through - // quorum to be revoked. To be accurate, renew request must wait for the - // deletion to complete. - case <-l.revokec: - return -1, ErrLeaseNotFound - // The expired lease might fail to be revoked if the primary changes. - // The caller will retry on ErrNotPrimary. - case <-demotec: - return -1, ErrNotPrimary - case <-le.stopC: - return -1, ErrNotPrimary + if !le.isPrimary() { + if l.remainingTTL > 0 { + le.checkpoint(id, 0) } + return l.ttl, nil } - // Clear remaining TTL when we renew if it is set - // By applying a RAFT entry only when the remainingTTL is already set, we limit the number - // of RAFT entries written per lease to a max of 2 per checkpoint interval. - if clearRemainingTTL { - le.cp(context.Background(), &pb.LeaseCheckpointRequest{Checkpoints: []*pb.LeaseCheckpoint{{ID: int64(l.ID), Remaining_TTL: 0}}}) - } - - le.mu.Lock() + le.checkpoint(id, 0) l.refresh(0) item := &LeaseWithTime{id: l.ID, time: l.expiry} le.leaseExpiredNotifier.RegisterOrUpdate(item) - le.mu.Unlock() leaseRenewed.Inc() return l.ttl, nil diff --git a/server/lease/lessor_test.go b/server/lease/lessor_test.go index 58a36e612323..9618fddc75db 100644 --- a/server/lease/lessor_test.go +++ b/server/lease/lessor_test.go @@ -434,19 +434,8 @@ func TestLessorExpire(t *testing.T) { t.Fatalf("failed to receive expired lease") } - donec := make(chan struct{}, 1) - go func() { - // expired lease cannot be renewed - if _, err := le.Renew(l.ID); err != ErrLeaseNotFound { - t.Errorf("unexpected renew") - } - donec <- struct{}{} - }() - - select { - case <-donec: - t.Fatalf("renew finished before lease revocation") - case <-time.After(50 * time.Millisecond): + if _, err := le.Renew(l.ID); err != nil { + t.Errorf("unexpected renew") } // expired lease can be revoked @@ -454,10 +443,9 @@ func TestLessorExpire(t *testing.T) { t.Fatalf("failed to revoke expired lease: %v", err) } - select { - case <-donec: - case <-time.After(10 * time.Second): - t.Fatalf("renew has not returned after lease revocation") + // revoked lease can't be renewed + if _, err := le.Renew(l.ID); err != ErrLeaseNotFound { + t.Errorf("unexpected renew") } } @@ -487,28 +475,15 @@ func TestLessorExpireAndDemote(t *testing.T) { t.Fatalf("failed to receive expired lease") } - donec := make(chan struct{}, 1) - go func() { - // expired lease cannot be renewed - if _, err := le.Renew(l.ID); err != ErrNotPrimary { - t.Errorf("unexpected renew: %v", err) - } - donec <- struct{}{} - }() - - select { - case <-donec: - t.Fatalf("renew finished before demotion") - case <-time.After(50 * time.Millisecond): + if _, err := le.Renew(l.ID); err != nil { + t.Errorf("unexpected renew: %v", err) } - // demote will cause the renew request to fail with ErrNotPrimary le.Demote() - select { - case <-donec: - case <-time.After(10 * time.Second): - t.Fatalf("renew has not returned after lessor demotion") + // renew should work after demote. + if _, err := le.Renew(l.ID); err != nil { + t.Errorf("unexpected renew: %v", err) } }