Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Cache being sequences that are 'old'. #8063
Conversation
|
As far as I can tell this looks OK. My question is how this interacts in HA with each agent pruning beings. Is there a bad interaction with beings that are running in other controllers? |
|
No. This uses the active pingers in the "presence.pings" collection to know what is safe/not safe to remove from the in-memory cache. It doesn't rely on who is pinging locally. Tested with specifically leaky Pingers. After running overnight I had:
And there was still no load on presence.presence.beings from mongotop.
(The controller is at DEBUG which probably also accounts for the 'log' load.) |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju |
jameinel commentedNov 13, 2017
•
Edited 1 time
-
jameinel
Nov 13, 2017
Description of change
It turns out that we actually have lots of ways to have old beings. We
don't want to have to read them from the database every time we do a
Sync. So instead we cache them as 'known-to-be-superseded', and we can
skip reading them from the database.
Even though we'll fix the bug that makes us leak 100s of agent pingers, we'll still always have a few extra connections for each controller agent (we currently have 4 for each agent). So it still allows Watcher.Sync() to be performed without hitting presence.beings at all (it still needs to read in the latest Pings() of course).
QA steps
In our current codebase, we have a bug where we are leaking Pingers, which causes us to start reading presence.presence.beings more than we would expect. Running this branch (without merging develop) should show that we don't actually trigger presence.beings reads. I included a test as well.
Documentation changes
Not significantly.
Bug reference
At least related to:
lp:1731745