Cami Sardinha wrote:
> Tobias Kreidl wrote:
>> The issue of having the LIMIT set, period, instead of it being an option 
>> is a concern.
>> If one ever gets behind, ti would appear that depending on the load, 
>> you'd never catch up.
>>
>> Your point was that there are times where you might actually deal with 
>> over 100,000 messages within an hour and
>> if that's sustained over a few hours, the cleanup will never catch up 
>> (unless it's aware that it hit the limit and is started
>> up again).  So, I agree with your concern about the LIMIT being 
>> implicitly set and would suggest that this could perhaps at least be 
>> overridden through a command line variable.
> 
> Please, if you're going to read the source code, at least do a thorough
> job of it. Do NOT change the MySQL queries until you understand exactly
> what is happening and why.
> 
> There is NO limit of 100 000, read the source code properly.

To be more specific, follow from function to function:

cleanup.c -> mysql.c -> db_deletequery();

db_deletequery()
..
   count=0;
..
start:
..
   /* fire off query */
   if (w_mysql_query(fd, "db_deletequery") != 0)
..
     /* MySQL does not handle extremely large deletes very well */
     if((int)mysql_affected_rows(mysql) == 100000)
     {
       count=count+(int)mysql_affected_rows(mysql);
       goto start;
       ^^^^^^^^^^^
            |
Re-run the delete query if we hit up against the 100 000 limit
as this gives MySQL a small "breather" window. (Keep re-running
the delete query until there is less than 100 000 rows deleted)

Running cleanup in DEBUG=3 mode shows you what is happening
in step-by-step detail.

Cami


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
policyd-users mailing list
policyd-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/policyd-users

Reply via email to