From 44a7acd519a5d7e1aa868e92e5ba8f54b4400d5d Mon Sep 17 00:00:00 2001 From: paladox Date: Thu, 13 Feb 2025 20:11:23 +0000 Subject: [PATCH] mediawiki: hash based on header for jobrunner haproxy config (#4187) --- .../templates/jobrunner_haproxy/lb.cfg.erb | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/modules/role/templates/jobrunner_haproxy/lb.cfg.erb b/modules/role/templates/jobrunner_haproxy/lb.cfg.erb index 3568cf245b..9cb0363ac4 100644 --- a/modules/role/templates/jobrunner_haproxy/lb.cfg.erb +++ b/modules/role/templates/jobrunner_haproxy/lb.cfg.erb @@ -7,44 +7,67 @@ listen jobrunner http-check expect status 405 http-reuse always mode http + bind :9007 bind :::9007 - balance roundrobin + + balance hdr(X-Request-ID) + hash-type consistent + <%- @backends.each_pair do | name, property | -%> <%- if property['depool'] != true-%> server <%= name %> <%= property['ip'] %>:<%= property['port'] %> ssl verify none check <%- end -%> <%- end -%> + http-request set-header Host jobrunner.wikitide.net + # Preserve the X-Request-ID header + http-request set-header X-Request-ID %[req.hdr(X-Request-ID)] + listen jobrunner_high option httpchk http-check send meth GET uri /rpc/RunSingleJob.php http-check expect status 405 http-reuse always mode http + bind :9008 bind :::9008 - balance roundrobin + + balance hdr(X-Request-ID) + hash-type consistent + <%- @backends.each_pair do | name, property | -%> <%- if property['depool'] != true -%> server <%= name %> <%= property['ip'] %>:<%= property['port'] %> ssl verify none check <%- end -%> <%- end -%> + http-request set-header Host jobrunner-high.wikitide.net + # Preserve the X-Request-ID header + http-request set-header X-Request-ID %[req.hdr(X-Request-ID)] + listen videoscaler option httpchk http-check send meth GET uri /rpc/RunSingleJob.php http-check expect status 405 http-reuse always mode http + bind :9009 bind :::9009 - balance roundrobin + + balance hdr(X-Request-ID) + hash-type consistent + <%- @backends.each_pair do | name, property | -%> <%- if property['depool'] != true -%> server <%= name %> <%= property['ip'] %>:<%= property['port'] %> ssl verify none check <%- end -%> <%- end -%> http-request set-header Host videoscaler.wikitide.net + + # Preserve the X-Request-ID header + http-request set-header X-Request-ID %[req.hdr(X-Request-ID)]