The delay for all_alteratives_failed can scale all the way up to 30.0 at a much slow time ratio

This commit is contained in:
Evan Tschannen 2019-08-09 12:35:19 -07:00
parent 0eb0e7a44a
commit 5f7d3498ea
3 changed files with 10 additions and 4 deletions

View File

@ -298,8 +298,10 @@ Future< REPLY_TYPE(Request) > loadBalance(
if(now() - g_network->networkMetrics.newestAlternativesFailure > FLOW_KNOBS->ALTERNATIVES_FAILURE_RESET_TIME) {
g_network->networkMetrics.oldestAlternativesFailure = now();
}
double delay = std::max(std::min((now()-g_network->networkMetrics.oldestAlternativesFailure)*FLOW_KNOBS->ALTERNATIVES_FAILURE_DELAY_RATIO, FLOW_KNOBS->ALTERNATIVES_FAILURE_MAX_DELAY), FLOW_KNOBS->ALTERNATIVES_FAILURE_MIN_DELAY);
double elapsed = now()-g_network->networkMetrics.oldestAlternativesFailure;
double delay = std::min(elapsed*FLOW_KNOBS->ALTERNATIVES_FAILURE_DELAY_RATIO, FLOW_KNOBS->ALTERNATIVES_FAILURE_MAX_DELAY);
delay = std::max(delay, std::min(elapsed*FLOW_KNOBS->ALTERNATIVES_FAILURE_SLOW_DELAY_RATIO, FLOW_KNOBS->ALTERNATIVES_FAILURE_SLOW_MAX_DELAY));
delay = std::max(delay, FLOW_KNOBS->ALTERNATIVES_FAILURE_MIN_DELAY);
// Making this SevWarn means a lot of clutter
if(now() - g_network->networkMetrics.newestAlternativesFailure > 1 || deterministicRandom()->random01() < 0.01) {

View File

@ -163,9 +163,11 @@ FlowKnobs::FlowKnobs(bool randomize, bool isSimulated) {
init( SECOND_REQUEST_BUDGET_GROWTH, 0.05 );
init( SECOND_REQUEST_MAX_BUDGET, 100.0 );
init( ALTERNATIVES_FAILURE_RESET_TIME, 5.0 );
init( ALTERNATIVES_FAILURE_MAX_DELAY, 1.0 );
init( ALTERNATIVES_FAILURE_MIN_DELAY, 0.05 );
init( ALTERNATIVES_FAILURE_DELAY_RATIO, 0.2 );
init( ALTERNATIVES_FAILURE_MAX_DELAY, 1.0 );
init( ALTERNATIVES_FAILURE_SLOW_DELAY_RATIO, 0.04 );
init( ALTERNATIVES_FAILURE_SLOW_MAX_DELAY, 30.0 );
init( FUTURE_VERSION_INITIAL_BACKOFF, 1.0 );
init( FUTURE_VERSION_MAX_BACKOFF, 8.0 );
init( FUTURE_VERSION_BACKOFF_GROWTH, 2.0 );

View File

@ -185,9 +185,11 @@ public:
double SECOND_REQUEST_BUDGET_GROWTH;
double SECOND_REQUEST_MAX_BUDGET;
double ALTERNATIVES_FAILURE_RESET_TIME;
double ALTERNATIVES_FAILURE_MAX_DELAY;
double ALTERNATIVES_FAILURE_MIN_DELAY;
double ALTERNATIVES_FAILURE_DELAY_RATIO;
double ALTERNATIVES_FAILURE_MAX_DELAY;
double ALTERNATIVES_FAILURE_SLOW_DELAY_RATIO;
double ALTERNATIVES_FAILURE_SLOW_MAX_DELAY;
double FUTURE_VERSION_INITIAL_BACKOFF;
double FUTURE_VERSION_MAX_BACKOFF;
double FUTURE_VERSION_BACKOFF_GROWTH;