Horizontal scaling: Distributor gRPC service + tests#669
Horizontal scaling: Distributor gRPC service + tests#669mum4k merged 11 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
source/distributor/service_impl.cc
Outdated
|
|
||
| namespace Nighthawk { | ||
|
|
||
| ::grpc::Status NighthawkDistributorServiceImpl::validateRequest( |
There was a problem hiding this comment.
can this be a private function in an anonymous namespace, rather than a private method object?
source/distributor/service_impl.cc
Outdated
|
|
||
| ::grpc::Status NighthawkDistributorServiceImpl::validateRequest( | ||
| const ::nighthawk::DistributedRequest& request) const { | ||
| auto& validation_visitor = Envoy::ProtobufMessage::getStrictValidationVisitor(); |
There was a problem hiding this comment.
nit: I think this would be more readable with ValidationVisitor& here instead of auto&. The type inference isn't quite obvious enough for me.
| if (status.ok()) { | ||
| std::tuple<grpc::Status, nighthawk::DistributedResponse> status_and_response = | ||
| handleRequest(request); | ||
| status = std::get<0>(status_and_response); |
There was a problem hiding this comment.
if we know status = ok, this line has no purpose.
There was a problem hiding this comment.
Well this does break the while loop when status is not OK?
source/distributor/service_impl.cc
Outdated
| const envoy::config::core::v3::Address& service, | ||
| const ::nighthawk::client::ExecutionRequest& request) const { | ||
| RELEASE_ASSERT(service_client_ != nullptr, "service_client_ != nullptr"); | ||
| std::unique_ptr<nighthawk::client::NighthawkService::Stub> stub; |
There was a problem hiding this comment.
can we instead declare this where it's used?
source/distributor/service_impl.cc
Outdated
| const ::nighthawk::client::ExecutionRequest& request) const { | ||
| RELEASE_ASSERT(service_client_ != nullptr, "service_client_ != nullptr"); | ||
| std::unique_ptr<nighthawk::client::NighthawkService::Stub> stub; | ||
| std::shared_ptr<::grpc::Channel> channel; |
There was a problem hiding this comment.
nit: remove :: at start of grpc::Channel
api/distributor/distributor.proto
Outdated
| repeated envoy.config.core.v3.Address services = 3 [(validate.rules).repeated .min_items = 1]; | ||
| } | ||
|
|
||
| message DistributedResponseFragment { |
There was a problem hiding this comment.
can we add a top-level explanation of the purpose of this object?
Also, looking at the code, I think that the intention here is that one of these is associated with every nighthawk service, and essentially operates as either:
- We failed to connect to this service
- Here's the service address.
Given that, is DistributedResponseFragment a good name here? I don't love the name fragment here, because it implies to me that they are parts of a whole (often without independent meaning outside of that whole).
There was a problem hiding this comment.
Yes this is spot on; I'll think about a better name here. Also open to suggestions.
There was a problem hiding this comment.
The DistributorRequest references services, so for a name how about DistributedServiceResponse or just DistributedResponse?
I think you were using Fragment to indicate that it's not the full resultset, but I don't think that's necessary here, as long as we document the intent.
(Some APIs I have used in the past have referred to this as an AsyncResponse, but I'm not sure how conventional that is).
There was a problem hiding this comment.
Renamed in 5462844. I went with DistributedServiceResponse, is DistributedResponse was already used in:
message DistributedResponse {
repeated DistributedServiceResponse service_response = 1;
}
mum4k
left a comment
There was a problem hiding this comment.
Just started the review and then noticed that there are still outstanding comments from @dubious90, so the code will change.
Sending what I have and will continue once the existing comments are addressed. But please let me know if I misunderstood and this is blocked on me.
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
…distributor-service Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
…distributor-service Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
mum4k
left a comment
There was a problem hiding this comment.
Looks good, just one question about asserts.
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com>
Part of the horizontal scaling effort: add gRPC distributor service + tests. This new gRPC service allows delegation of load test execution initiation messages to a set of load generator services. Signed-off-by: Otto van der Schaaf <ovanders@redhat.com> Signed-off-by: William Juan <66322422+wjuan-AFK@users.noreply.github.com>
Part of the horizontal scaling effort: add gRPC distributor service + tests.
This new gRPC service allows delegation of load test execution initiation messages
to a set of load generator services.
Signed-off-by: Otto van der Schaaf ovanders@redhat.com