1

Immediately after reindexing the Catalog URL Rewrites, Magento says we need to reindex them again. I'm using the command line to run indexer.php as a background task:

nohup php indexer.php --reindex catalog_url > /home/ubuntu/rewrites_index_20130218 2> /home/ubuntu/rewrites_index_20130218.err < /dev/null &

The Index Management screen shows "Processing" on the relevant row while this runs, but reverts to "Reindex Required" once completed.

The output file rewrites_index_20130218 says that the reindex completed successfully. The rewrites_index_20130218.err is empty. The files system.log and exception.log in Magento's log folder are both clean.

On a previous attempt last night, the index failed due to too many MySQL locked tables. I increased the MySQL innodb_buffer_pool_size and restarted MySQL and we're not getting that issue now.

I have deliberately run the indexing when I know for certain that nobody from the team is working in the Magento admin area.

What would cause the rewrites table to need to be reindexed so often, or if that's not obvious, what steps could I take to identify the cause of the problem?

Aaron Pollock
  • 1,169
  • 1
  • 13
  • 22

2 Answers2

1

Its really simple. The indexing process did not remove the 'lock process' flag either in the Database or the actual lock file in /var/locks/

you can rm * in /var/locks or look at the indexing table in the database... so no it doesn't need to be indexed again, the lock just wasn't cleared during the process. Check your permissions on /var as well.

mprototype
  • 535
  • 2
  • 9
  • Wouldn't the lock file make it show "Processing" continuously even when it's finished? That's not what's happening. – Aaron Pollock Feb 21 '13 at 10:16
  • Yes a lock file would make it continually show processing. Also if the indexing process didn't change the status in the indexing table in the database it would show processing continuously... use grep and look @ the processes running on the server, or check mysql and look at the processes running... it is phantom, it has already completed. – mprototype Feb 21 '13 at 22:03
  • I don't think you've understood the problem. It didn't show "Processing", it actually completed successfully, but then immediately showed "Reindex Required". – Aaron Pollock Feb 22 '13 at 10:13
0

Is the indexing mode set to Manual Update?

If that's the case and an indexing event (for exmaple a placed order) happens to occur while the indexer is running, the status of the index will be automatically revert back to "Reindex Required".

See Mage_Index_Model_Process::reindexAll:

$unprocessedEvents = $eventResource->getUnprocessedEvents($this);
if ($this->getMode() == self::MODE_MANUAL && (count($unprocessedEvents) > 0)) {
    $this->_getResource()->updateStatus($this, self::STATUS_REQUIRE_REINDEX);
} else {
    $this->_getResource()->endProcess($this);
}
nnevala
  • 101
  • 1