Commit 98f54a4
committed
presence: Fix database purge of activewatchers (clustering, no fallback2db)
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:
+------------+------------+
| fallback2- | fallback2- |
| -db = on | -db = off |
+-clustering:-+------------+------------+
| - no | OK | OK |
| - tagless | PR-2519 | PR-2519 |
| - active | OK | this |
+-------------+------------+------------+
The non-OK behaviour above refers to the activewatcher table getting
filled up with stale/expired items.
fallback2db on or off:
```
modparam("presence", "fallback2db", 0) # or 1=on
```
The no-clustering case:
```
handle_subscribe();
```
The tagless case:
```
modparam("presence", "cluster_id", 1)
modparam("clusterer", "my_node_id", 2)
handle_subscribe();
```
The active case:
```
modparam("presence", "cluster_id", 1)
modparam("clusterer", "my_node_id", 2)
modparam("clusterer", "sharing_tag", "node2/1=active")
handle_subscribe("0", "node2");
```
Where PR OpenSIPS#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
it's not a problem if the perioding cleanup had cleaned those records
already.)1 parent 7f7118b commit 98f54a4
1 file changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
1367 | | - | |
| 1367 | + | |
1368 | 1368 | | |
1369 | | - | |
| 1369 | + | |
| 1370 | + | |
1370 | 1371 | | |
1371 | 1372 | | |
1372 | 1373 | | |
| |||
1472 | 1473 | | |
1473 | 1474 | | |
1474 | 1475 | | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1475 | 1481 | | |
1476 | 1482 | | |
1477 | 1483 | | |
1478 | 1484 | | |
1479 | 1485 | | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
1483 | 1489 | | |
1484 | 1490 | | |
1485 | 1491 | | |
| |||
1639 | 1645 | | |
1640 | 1646 | | |
1641 | 1647 | | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1642 | 1654 | | |
1643 | 1655 | | |
1644 | 1656 | | |
1645 | | - | |
| 1657 | + | |
1646 | 1658 | | |
1647 | 1659 | | |
1648 | 1660 | | |
| |||
0 commit comments