Page MenuHomePhabricator

maintenance/updateSearchIndex.php gives Error: 1100 Table 'page_restrictions' was not locked with LOCK TABLES
Closed, ResolvedPublic

Description

It seems updateSearchIndex.php is broken. The "same" bug was reported in T42302 but on a different table. When adding page_restrictions to the lockSearchindex function in Maintenance.php it seems to work.

	/**
	 * Lock the search index
	 * @param &$db DatabaseBase object
	 */
	private function lockSearchindex( &$db ) {
		$write = array( 'searchindex' );
		$read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user', 'page_restrictions' );
		$db->lockTables( $read, $write, __CLASS__ . '::' . __METHOD__ );
	}

But then the script ends with the below message which seems to mean that something else is not working.

   --- Unlocking --
Done
*** Couldn't write to the searchUpdate.newwikidb.pos!

This was tested on a clean MW-1.23.7 & MW-1.24.1 install but I found out on our production wiki running MW-1.22.5.

Event Timeline

Jongfeli raised the priority of this task from to Needs Triage.
Jongfeli updated the task description. (Show Details)
Jongfeli subscribed.
Jongfeli set Security to None.

Change 192710 had a related patch set uploaded (by Physikerwelt):
Add page_restrictions to readlock in lockSearchindex

https://gerrit.wikimedia.org/r/192710

Change 192710 merged by jenkins-bot:
Add page_restrictions to readlock in lockSearchindex

https://gerrit.wikimedia.org/r/192710

Change 219491 had a related patch set uploaded (by Lewis Cawte):
Add page_restrictions to readlock in lockSearchindex

https://gerrit.wikimedia.org/r/219491

lcawte subscribed.

Issue present in 1.25.1.

Change 219491 merged by jenkins-bot:
Add page_restrictions to readlock in lockSearchindex

https://gerrit.wikimedia.org/r/219491

Umherirrender claimed this task.

Issue present under MW 1.28 (table user_properties).