Cache being sequences that are 'old'. #8063
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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