diff --git a/mcrouter/ProxyConfig-inl.h b/mcrouter/ProxyConfig-inl.h index 18d081851..393ec7ffa 100644 --- a/mcrouter/ProxyConfig-inl.h +++ b/mcrouter/ProxyConfig-inl.h @@ -128,6 +128,12 @@ ProxyConfig::ProxyConfig( bool enableAsyncDlBroadcast = readBool("enable_async_dl_broadcast", false); + bool enableCrossRegionSetRpc = readBool("enable_cross_region_set_rpc", true); + bool enableSetDistribution = readBool("enable_set_distribution", false); + checkLogic( + enableSetDistribution || enableCrossRegionSetRpc, + "ProxyConfig: cannot disable cross-region set rpc if set distribution is disabled"); + proxy.router().runtimeFeatures_.enableOdslScuba = readBool("enable_odsl_scuba", false); proxy.router().runtimeFeatures_.enableOdslODS = @@ -143,7 +149,9 @@ ProxyConfig::ProxyConfig( RootRouteRolloutOpts{ .enableDeleteDistribution = enableDeleteDistribution, .enableCrossRegionDeleteRpc = enableCrossRegionDeleteRpc, - .enableAsyncDlBroadcast = enableAsyncDlBroadcast}); + .enableAsyncDlBroadcast = enableAsyncDlBroadcast, + .enableSetDistribution = enableSetDistribution, + .enableCrossRegionSetRpc = enableCrossRegionSetRpc}); serviceInfo_ = std::make_shared>(proxy, *this); } diff --git a/mcrouter/routes/RootRoute.h b/mcrouter/routes/RootRoute.h index 67dce7fc6..3425a2853 100644 --- a/mcrouter/routes/RootRoute.h +++ b/mcrouter/routes/RootRoute.h @@ -30,6 +30,8 @@ struct RootRouteRolloutOpts { bool enableDeleteDistribution = false; bool enableCrossRegionDeleteRpc = true; bool enableAsyncDlBroadcast = false; + bool enableSetDistribution = false; + bool enableCrossRegionSetRpc = true; }; template @@ -52,7 +54,9 @@ class RootRoute { defaultRoute_(opts_.default_route), enableDeleteDistribution_(rolloutOpts.enableDeleteDistribution), enableCrossRegionDeleteRpc_(rolloutOpts.enableCrossRegionDeleteRpc), - enableAsyncDlBroadcast_(rolloutOpts.enableAsyncDlBroadcast) {} + enableAsyncDlBroadcast_(rolloutOpts.enableAsyncDlBroadcast), + enableSetDistribution_(rolloutOpts.enableSetDistribution), + enableCrossRegionSetRpc_(rolloutOpts.enableCrossRegionSetRpc) {} template bool traverse( @@ -131,6 +135,8 @@ class RootRoute { bool enableDeleteDistribution_; bool enableCrossRegionDeleteRpc_; bool enableAsyncDlBroadcast_; + bool enableSetDistribution_; + bool enableCrossRegionSetRpc_; template FOLLY_ALWAYS_INLINE ReplyT getTargetsAndRoute(