BBlack has submitted this change and it was merged. Change subject: varnish: remove chash director leftovers ......................................................................
varnish: remove chash director leftovers Bug: T150660 Change-Id: I9b04b8c15707802d283a8402289d5f33d104c224 --- M modules/varnish/templates/vcl/directors.vcl.tpl.erb M modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb 2 files changed, 2 insertions(+), 34 deletions(-) Approvals: Ema: Looks good to me, but someone else must approve BBlack: Verified; Looks good to me, approved diff --git a/modules/varnish/templates/vcl/directors.vcl.tpl.erb b/modules/varnish/templates/vcl/directors.vcl.tpl.erb index 4b90524..feadcdf 100644 --- a/modules/varnish/templates/vcl/directors.vcl.tpl.erb +++ b/modules/varnish/templates/vcl/directors.vcl.tpl.erb @@ -1,16 +1,3 @@ -<% -# Calculates number of director-level retries necessary for chash to hit all -# "n" backends with probability percentage "p", given they're randomly-mixed -# into an array considerably larger in size than "n". This is an -# overestimation in that it assumes an infinite array, but the values still -# come out reasonably small compared to doing anything based on our actual -# weight*num_backends. -# Blame _joe_ for the math! :) -def chash_def_retries(p, n) - return n if n == 1 - return ((Math.log10(100 - p) - 2) / (Math.log10(n - 1) - Math.log10(n))).ceil -end --%> <% @directors.keys.sort.each do |director_name| director = @directors[director_name] diff --git a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb index b00eea1..ec72982 100644 --- a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb +++ b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb @@ -22,22 +22,6 @@ include "errorpage.inc.vcl"; -<% -# Calculates number of director-level retries necessary for chash to hit all -# "n" backends with probability percentage "p", given they're randomly-mixed -# into an array considerably larger in size than "n". This is an -# overestimation in that it assumes an infinite array, but the values still -# come out reasonably small compared to doing anything based on our actual -# weight*num_backends. -# Blame _joe_ for the math! :) -def chash_def_retries(p, n) - x = n - 1 - if (x <= 0) - return n - end - return ((Math.log10(100 - p) - 2) / (Math.log10(x) - Math.log10(n))).ceil -end --%> # ACLs @@ -92,7 +76,7 @@ # @varnish_directors = { # 'director name' => { # 'dynamic' => 'yes', # or 'no', required -# 'type' => 'chash', # required +# 'type' => 'vslp', # required # 'dc' => 'eqiad', # required if dynamic==yes # 'service' => 'foo', # required if dynamic==yes # 'backends' => [ "backend1", "backend2" ], # required: array or single value @@ -111,7 +95,7 @@ # the director name into the backend host's "backend" name as well, but so far # we have no cases where this is necessary! (whereas we do have cases of # duplicate backend hosts where the options are always identical, for -# chashed-vs-random cache backends) +# vslp-vs-random cache backends) # # Puppet-generated the Backend host definitions, regardless of 'dynamic' @@ -163,9 +147,6 @@ <% else -%> new <%= director_name %> = directors.<%= director['type'] %>(); <% end %> -<% if director['type'] == 'chash' -%> - .retries = <%= chash_def_retries(99, backends.size) %>; -<% end -%> <% backends.each do |backend| name = 'be_' + backend.gsub(/[-.]/, '_') -- To view, visit https://gerrit.wikimedia.org/r/322885 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b04b8c15707802d283a8402289d5f33d104c224 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: Ema <e...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits