I have a SuiteCRM instance with 20000 records in two modules. Yesterday I started cron.php on the server. Lucene indexing hasn’t stopped since.
It is constantly shuffling data in crm/modules/AOD_Index/Index/Index/, which probably means it’s not stalled or anything. I have reniced the process to 19, so it wouldn’t slow down rest of the hosted sites.
But seriously, what is it actually doing and is it supposed to run this long?
It basically just recreates the index file over and over again, at first I thought that it was doing some btree shuffling or whatever, but every time a new .cfs file is created … it runs the index again. I am now at _gxc.cfs. Which from base36 is 21936 repetitions of the same index.
Now, one solution would be, to monitor the cron job and kill it after a few minutes, but that might mess up other scheduled services. And then a sql call would have to be made to modify the job log, so as to allow the index to run next time.
$query = "SELECT b.id FROM ".$bean->getTableName()." b LEFT JOIN aod_indexevent ie ON (ie.record_id = b.id AND ie.record_module = '".$beanModule."') WHERE b.deleted = 0 AND (ie.id IS NULL OR ie.date_modified < b.date_modified)";
Oh joy, this is going to be some bs somewhere isn’t it…
SELECT DISTINCT(`record_module`) FROM `aod_indexevent`;
SELECT b.id,b.* FROM leads b LEFT JOIN aod_indexevent ie ON (ie.record_id = b.id AND ie.record_module = 'Leads') WHERE b.deleted = 0 AND (ie.id IS NULL OR ie.date_modified < b.date_modified);
date_modified: 2017-05-06 13:06:00
DING DING DING, we have a candidate! Will he get a cigar or will it be latrine duty. Find out in our next installment…
Fine, let’s reset the indexing process and do a fresh index. Oh boy, this is taking longer than expected. Well renice it is and I am gonna get some grub [hehe].