Skip to content

rds: migrate RDS to Subscription model.#1441

Merged
htuch merged 2 commits intoenvoyproxy:masterfrom
htuch:rds-subscription
Aug 11, 2017
Merged

rds: migrate RDS to Subscription model.#1441
htuch merged 2 commits intoenvoyproxy:masterfrom
htuch:rds-subscription

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented Aug 10, 2017

Legacy REST adapter translates REST JSON API fetches to a v2 Subscription, similar to
CDS/SDS/EDS.

Legacy REST adapter translates REST JSON API fetches to a v2 Subscription, similar to
CDS/SDS/EDS.
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

nice! getting close.

Comment thread source/common/router/rds_impl.cc Outdated
// strong hash instead.
const std::string manager_identifier =
config.getString("route_config_name") + MAP_CONCATENATOR + config.getString("cluster");
rds.route_config_name() + MAP_CONCATENATOR + rds.SerializeAsString();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't rds.SerializeAsString() basically include the route config name already? Per your TODO should we just switch to hashing on rds.SerializeAsString() itself?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, that was me just mechanically replacing things, thanks for pointing this out. I'm wondering about whether we have concerns if we use std::hash here - it's not crypto strong, the standard doesn't impose any strength requirements on the hash. So far, if we get collisions in xDS update hashes, we can miss updates, in this case we can actually get the wrong route table. Should we use a strong hash from BoringSSL or something? It seems using weak hashes is only legit if you also do a compare against the original strings to ensure there are no collisions, as you would in a simple hash table implementation for example. But, we don't keep these around if we're hashing as we do today.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In this case, AFAIK unordered_maps don't just hash, they hash and then do a full string compare, so it should be fine. In the API cases, I actually think it's a mistake that we use the hash to decide whether to update or not (though it's nice for performance). Would be good to think about that and see if we want to change that, but that's a separate issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, fine with unordered_map here, just wanted to avoid an additional hash. I've opened #1452 to track this for the general xDS API update checks.

@htuch htuch mentioned this pull request Aug 11, 2017
3 tasks
@htuch htuch merged commit 873f304 into envoyproxy:master Aug 11, 2017
@htuch htuch deleted the rds-subscription branch August 11, 2017 15:26
mathetake added a commit that referenced this pull request Mar 3, 2026
**Description**

This commit disables -race flag by default and only explicitly set it on
the CI. This improves the local devx since usually the race condition
won't be an issue at the initial iteration of changes.

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.

2 participants