presence: Fix database purge of activewatchers (clustering, fallback2db=0) #2520
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.
When clustering sharing_tags were added to presence, they were added to the fallback2db "on" case only:
There are a couple of dimensions with differing behaviours:
The non-OK behaviour above refers to the activewatcher table getting filled up with stale/expired items.
fallback2db on or off:
The no-clustering case:
The tagless case:
The active case:
Where PR #2519 fixes the tagless case, this PR fixes the
fallback2db=0
case by writing the sharing_tag to the database so the records can get found and cleaned up.(Sidenote: subscriptions which ended with a timeout or 481 would get cleaned up. This makes sense in all cases: if they have an error before their expiry, it makes sense to purge them from the DB immediately. And if the periodic cleanup had cleaned those records already, it would not be an issue.)