Hello, I have noticed, that NAV is reporting jobs as overdue, even though a job end with success. I believe the problem is caused by trigger trim_old_ipdevpoll_job_log_entries, which should delete the old jobs from the ipdevpoll_job_log table.
DELETE FROM ipdevpoll_job_log WHERE id IN (SELECT id FROM ipdevpoll_job_log WHERE job_name=NEW.job_name AND netboxid=NEW.netboxid ORDER BY end_time ASC OFFSET 100);
When there are 100 log entries for a job in the nav database the trigger will delete the newest logged job instead of oldest one. I believe, that the ORDER BY clause should be DESC not ASC.
Regards,
M.
On Fri, 23 Nov 2012 02:10:36 +0100 Matej Gregr igregr@fit.vutbr.cz wrote:
Hello,
Hello Matej!
I have noticed, that NAV is reporting jobs as overdue, even though a job end with success. I believe the problem is caused by trigger trim_old_ipdevpoll_job_log_entries, which should delete the old jobs from the ipdevpoll_job_log table.
DELETE FROM ipdevpoll_job_log WHERE id IN (SELECT id FROM ipdevpoll_job_log WHERE job_name=NEW.job_name AND netboxid=NEW.netboxid ORDER BY end_time ASC OFFSET 100);
When there are 100 log entries for a job in the nav database the trigger will delete the newest logged job instead of oldest one. I believe, that the ORDER BY clause should be DESC not ASC.
Thanks for taking the time to give such a detailed report! However, this is a known bug [1], and it was fixed in NAV 3.12.1. It's time to upgrade :-)
[1] https://bugs.launchpad.net/nav/+bug/1053866
On 11/23/2012 10:12 AM, Morten Brekkevold wrote:
On Fri, 23 Nov 2012 02:10:36 +0100 Matej Gregr igregr@fit.vutbr.cz wrote:
Hello,
Hello Matej!
I have noticed, that NAV is reporting jobs as overdue, even though a job end with success. I believe the problem is caused by trigger trim_old_ipdevpoll_job_log_entries, which should delete the old jobs from the ipdevpoll_job_log table.
DELETE FROM ipdevpoll_job_log WHERE id IN (SELECT id FROM ipdevpoll_job_log WHERE job_name=NEW.job_name AND netboxid=NEW.netboxid ORDER BY end_time ASC OFFSET 100);
When there are 100 log entries for a job in the nav database the trigger will delete the newest logged job instead of oldest one. I believe, that the ORDER BY clause should be DESC not ASC.
Thanks for taking the time to give such a detailed report! However, this is a known bug [1], and it was fixed in NAV 3.12.1. It's time to upgrade :-)
Hi Morten, ahh, I was searching the bug reports, but apparently I missed it and I also missed the fix in the sql files even though I was searching the changes :/
However: nav ~> nav version NAV 3.12.2
and the DB scheme is still the same (old with the error), so the fix was not applied. Strange.
M.
On Fri, 23 Nov 2012 13:37:11 +0100 Matej Gregr igregr@fit.vutbr.cz wrote:
However: nav ~> nav version NAV 3.12.2
and the DB scheme is still the same (old with the error), so the fix was not applied. Strange.
Can you verify the schema using NAV's syncdb.py?