Adding new sites with allocated ports re-shuffled, race between haproxy and nginx reload

Bug #1865945 reported by Haw Loeung
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Content Cache Charm
Fix Released
Critical
Haw Loeung

Bug Description

Hi,

When adding new sites, allocated ports for both nginx cache and the backend haproxy stanzas are reshuffled around. This can cause issues with requests hitting the wrong backends and caching that. We should fix this, likely by having haproxy and nginx reload at the same time. Or store a persistent map of sites and allocated ports.

We could also use this opportunity to remove the haproxy backend layer (nginx -> haproxy -> backend) since we now have full metrics from nginx's LUA script.

Related branches

Haw Loeung (hloeung)
summary: - Adding new sites with port allocates shuffling, race between haproxy and
- nginx reload
+ Adding new sites with allocated ports re-shuffled, race between haproxy
+ and nginx reload
Junien F (axino)
Changed in content-cache-charm:
importance: Undecided → High
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: New → Triaged
Revision history for this message
Haw Loeung (hloeung) wrote :

So what's left is to add mapping sites to ports so new sites allocated unused port-pairs and existing sites retains the same set of port-pairs.

Revision history for this message
Haw Loeung (hloeung) wrote :

We really need this still as there are cases where HAProxy reload fails to make new changes live, see LP:1828496.

Joel Sing (jsing)
Changed in content-cache-charm:
importance: High → Critical
Revision history for this message
Joel Sing (jsing) wrote :

While we can consider switching to haproxy/nginx rather than haproxy/nginx/haproxy, we should do this separately as it is a bigger change and has greater potential to create unintended impact.

For the time being, the ports should be kept persistent - this will address the issue, should be a quick change and the impact of doing so is known.

Haw Loeung (hloeung)
Changed in content-cache-charm:
assignee: nobody → Haw Loeung (hloeung)
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: Triaged → In Progress
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: In Progress → Fix Committed
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.