Skip to content

Periodically send empty report to detect rollout changes#769

Merged
qiwzhang merged 3 commits intocloudendpoints:masterfrom
qiwzhang:fetch_report
Mar 13, 2020
Merged

Periodically send empty report to detect rollout changes#769
qiwzhang merged 3 commits intocloudendpoints:masterfrom
qiwzhang:fetch_report

Conversation

@qiwzhang
Copy link
Copy Markdown
Contributor

Signed-off-by: Wayne Zhang qiwzhang@google.com

Sending an empty report to ServiceControl will be replied by the latest rollout ID.
Using this way to detect if service config rollout has been updated.
Update the e2e test, by not sending traffic to test if config has been updated.

Signed-off-by: Wayne Zhang <qiwzhang@google.com>
@qiwzhang qiwzhang requested review from JLXIA, TAOXUY and nareddyt March 13, 2020 05:46
Comment thread src/api_manager/config_manager.cc Outdated
Comment thread src/api_manager/proto/server_config.proto
ReportResponse* response = new ReportResponse;
Call(request, response,
[this, response](const ::google::protobuf::util::Status&) {
delete response;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm confused: Where does ESP read the latest rollout ID from the ReportResponse? Shouldn't it be using the response to check for it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just using the existing code to process the Check/Report response. It is in the HandleRespones() function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change only adds timer to trigger a dummy Report calls in every minutes. The existing code will handle the rest: on every check/response code it will check rollout id, then it set to a callback function which is intercepted by config_manager.

Copy link
Copy Markdown
Contributor

@TAOXUY TAOXUY left a comment

Choose a reason for hiding this comment

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

Since right now we don't polling on servicemanagement, I suggest we change the logic from timer trigger to be a new rollout trigger(in the callback). The benefit would be the new rollout can be updated soon. It can be 60s earlier at the edge case if the servicemangement timer is triggered just before the empty report timer and new rollout fetched by empty report has to wait extra 60s. Same for real report update.

Also, maybe add unit test to cover this change.

@qiwzhang
Copy link
Copy Markdown
Contributor Author

qiwzhang commented Mar 13, 2020

Hi @TAOXUY, I did not quite understand what you mean by rollout trigger. Could you elaborate?

@TAOXUY
Copy link
Copy Markdown
Contributor

TAOXUY commented Mar 13, 2020

Hi @TAOXUY did you quite understand your rollout trigger? what do you mean by that?

Here, a new fetch depends on 1. new config rollout id 2. the timer fire. Before, we cannot rely on the update of real report if no requests coming. Now, since 1. is relied on another timer by sending empty report request, we really don't need 2. and we can just fetch the new config.

@qiwzhang
Copy link
Copy Markdown
Contributor Author

qiwzhang commented Mar 13, 2020

@TAOXUY Here, this timer is for throttle purpose. It is AFTER detected rollout change, but not to call ServiceManagment at the same time, we need to throttle it in a 5 minute window so different proxy instance will call it at different time within that window to make sure Inception can handle the load.

We still need that throttle features.

@TAOXUY
Copy link
Copy Markdown
Contributor

TAOXUY commented Mar 13, 2020

@TAOXUY Here, this timer is for throttle purpose. It is AFTER detected rollout change, but not to call ServiceManagment at the same time, we need to throttle it in a 5 minute window so different proxy instance will call it at different time within that window to make sure Inception can handle the load.

We still need that throttle features.

I see. IMHO, now the polling(checking latest rollout) pressure is moved from servicemanagement to servicecontrol, is it still necessary to throttle?

@qiwzhang
Copy link
Copy Markdown
Contributor Author

Yes, fetching service config is from ServiceManagement, we should not add too much load to that service. We still need to throttle it.

@qiwzhang qiwzhang merged commit bf1996a into cloudendpoints:master Mar 13, 2020
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.

3 participants