Skip to content

implement rds api#464

Merged
mattklein123 merged 9 commits intomasterfrom
rds
Feb 13, 2017
Merged

implement rds api#464
mattklein123 merged 9 commits intomasterfrom
rds

Conversation

@mattklein123
Copy link
Member

@mattklein123 mattklein123 commented Feb 10, 2017

fixes #298
fixes #463

@mattklein123
Copy link
Member Author

@lyft/network-team @rshriram @GregHanson


route_config_name
*(required, string)* The name of the route table. This name will be passed to the
:ref:`RDS HTTP API <config_http_conn_man_rds_api>` so that different route tables can be used by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean to be used by independent filters?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant independent listeners?


/**
* @return Router::ConfigPtr a route configuration for use during a single request. The returned
* config may be different on a subsequent call so a new config should be acquired for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comma before so

"generate_request_id" : {"type" : "boolean"}
},
"required" : ["codec_type", "stat_prefix", "route_config", "filters"],
"required" : ["codec_type", "stat_prefix", "filters"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should keep route_config. At line 222, it only checks for an object, so empty will pass. And the documentation above makes it seem like it should always be there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccaraman if that line in the documentation is removed, it aligns well with the rest of the checks in rds_impl.cc. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required anymore. I'm fixing the docs.

Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general doc comments.
Also need a note saying that existing connections to older routes will continue to have same retry/timeout semantics as they were specified during connection initiation.

Given that the combination of RDS/CDS and SDS is (almost) effectively a hot reload with new config, do any of the drain timeout semantics apply? Most probably they don't, but it is worth mentioning in doc, as one liner. WDYT?

=======================

The route discovery service (RDS) API is an optional API that Envoy will call to dynamically fetch
route tables. Each :ref:`HTTP connection manager filter <config_http_conn_man>` can independently
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/route tables/HTTP route entries/ for clarity ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even better: dynamically fetch configurations for virtual hosts and routes within the virtual host.


route_config_name
*(required, string)* The name of the route table. This name will be passed to the
:ref:`RDS HTTP API <config_http_conn_man_rds_api>` so that different route tables can be used by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant independent listeners?

*(sometimes required, object)* The connection manager configuration must specify one of *rds* or
*route_config*. If *route_config* is specified, the :ref:`route table <arch_overview_http_routing>`
for the connection manager is static and is specified in this property. All connection managers must have
a route table, even if it is empty.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this line. It sounds like if you use rds, you still need a dummy empty route_config block

"generate_request_id" : {"type" : "boolean"}
},
"required" : ["codec_type", "stat_prefix", "route_config", "filters"],
"required" : ["codec_type", "stat_prefix", "filters"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccaraman if that line in the documentation is removed, it aligns well with the rest of the checks in rds_impl.cc. WDYT?

log_debug("rds: parsing response");
Json::ObjectPtr response_json = Json::Factory::LoadFromString(response.bodyAsString());
uint64_t new_hash = response_json->hash();
if (new_hash != last_config_hash_ || !initialized_) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this warrants a comment somewhere in the docs. Something like The new/old routes will be compared based on their hashes. If they differ, then the newer route will be loaded. So care must be taken by the RDS provider to ensure that the order of routes in a RDS response remains unchanged across API calls.
WDYT ?
Most probably, the same applies to CDS as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add some detail in the docs. It's just a performance optimization for the route config to now reload internally, so I don't think it's worth guiding developers to not reorder things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, yeah you are right. It was more for istio, where we are making sure that the config remains as deterministic as possible between every refresh.


/**
* Implementation of RouteConfigProvider that returns a static null route config.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/RouteConfigProvider/NullRouteConfigProvider/ ?

@mattklein123
Copy link
Member Author

@ccaraman @rshriram updated from comments. Also, I opened #468 to do a full overview of all of the configuration options now available. I will do this as an independent change.

This makes all of the REST API configs consistent.

fixes #463
Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mattklein123 . LGTM. We will start testing this soon

"auth_api_cluster": "...",
"stat_prefix": "...",
"refresh_interval_ms": "...",
"refresh_delay_ms": "...",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that CLIENT_SSL_NETWORK_FILTER_SCHEMA doesn't have refresh_delay_ms. Can you please add that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


.. http:get:: /v1/routes/(string: route_config_name)/(string: service_cluster)/(string: service_node)

Asks the discovery service to return the route configuration for a particular `route_config_name`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asks the route dicovery service... People might get confused.

NiceMock<Upstream::MockClusterManager> cm;
EXPECT_CALL(cm, get("www2")).WillRepeatedly(Return(nullptr));

ConfigImpl(*loader, runtime, cm, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a EXPECT_NO_THROW

@mattklein123 mattklein123 merged commit a1aceb8 into master Feb 13, 2017
@mattklein123 mattklein123 deleted the rds branch February 13, 2017 20:19
rshriram pushed a commit to rshriram/envoy that referenced this pull request Oct 30, 2018
lizan pushed a commit to lizan/envoy that referenced this pull request Apr 24, 2020
Support Grpc initial metadata in Wasm.
wolfguoliang pushed a commit to wolfguoliang/envoy that referenced this pull request Jan 23, 2021
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
mathetake added a commit that referenced this pull request Mar 3, 2026
**Commit Message**

This removes the unnecessary fields from the expected output of
translation test case.

**Related Issues/PRs (if applicable)**

Contributes to #412

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refresh_delay_ms vs refresh_interval_ms Consider adding Route Discovery Service (RDS) API

4 participants