View Issue Details

IDProjectCategoryView StatusLast Update
0001565Anope Development (1.9.x series)Ext DB Supportpublic2014-03-09 06:34
Reporterwaser Assigned ToDukePyrolator  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Fixed in Version1.9.x-GIT 
Summary0001565: SQL table chan gives negative number of users
DescriptionIn some cases, the stattistics on channels gives a negative number of users.
Steps To ReproduceIt seemed to happen after an attack over a network, so I assume it was the massive join/part to be the problem.
Additional Informationusing anope 2 rc1
TagsNo tags attached.

Activities

DukePyrolator

2014-03-09 06:34

administrator   ~0006605

bug confirmed, but I was unable to debug it.

whilst looking at it I decided to remove the currentusers field.
keeping this field updated eats too many resources.
On a big network this field has to be updated several thousand times a day,
but you need it only a few times when someone want to see the stats on a website.

if you need the currentusers of a channel you can always use:

SELECT count(i.chanid) AS currentusers
   FROM anope_chan AS c, anope_ison AS i
   WHERE i.chanid=c.chanid and c.channel="#name";

or for the top10 channels:

SELECT c.channel, count(i.chanid) AS currentusers
   FROM anope_chan AS c, anope_ison AS i
   WHERE i.chanid=c.chanid
   GROUP BY c.chanid
   ORDER BY currentusers DESC
   LIMIT 10;

"fixed" in https://github.com/anope/anope/commit/4b5ce8a9728db477b75766a60aec48981eff0750

Issue History

Date Modified Username Field Change
2014-01-30 00:16 waser New Issue
2014-03-09 06:34 DukePyrolator Note Added: 0006605
2014-03-09 06:34 DukePyrolator Status new => resolved
2014-03-09 06:34 DukePyrolator Fixed in Version => 1.9.x-GIT
2014-03-09 06:34 DukePyrolator Resolution open => fixed
2014-03-09 06:34 DukePyrolator Assigned To => DukePyrolator