Page MenuHomePhabricator

WMF servers missing part of cl_sortkey index, live hack breaks list=categorymembers&cmsort=sortkey
Closed, ResolvedPublic

Description

The WMF servers have KEY cl_timestamp (cl_to,cl_timestamp) whereas tables.sql has CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from) . The cl_from field in the index is needed to make list=categorymembers&cmsort=sortkey non-lethal to the database servers, but because it's not there on the WMF servers, WMF uses a live hack that breaks paging for cmsort=sortkey completely.

The index should be updated on all WMF servers and the live hack removed.


Version: unspecified
Severity: normal

Details

Reference
bz17558

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:31 PM
bzimport set Reference to bz17558.
bzimport added a subscriber: Unknown Object (MLST).

Changing product and component, this is a WMF issue

Not sure what the cl_timestamp key has to do with anything. Wikimedia appears to be missing patch-categorylinksindex.sql, from bug 10280. That is, it has an index called cl_sortkey already, but it is (cl_to,cl_sortkey) instead of (cl_to,cl_sortkey,cl_from).

(In reply to comment #2)

Not sure what the cl_timestamp key has to do with anything. Wikimedia appears
to be missing patch-categorylinksindex.sql, from bug 10280. That is, it has an
index called cl_sortkey already, but it is (cl_to,cl_sortkey) instead of
(cl_to,cl_sortkey,cl_from).

Yeah, that's probably what I meant; the cl_timestamp thing must've been a mistake.

Most probably fixed in r83814 and following commits.

  • This bug has been marked as a duplicate of bug 27965 ***

(In reply to comment #5)

Most probably fixed in r83814 and following commits.

  • This bug has been marked as a duplicate of bug 27965 ***

You sure? the issues don't sound that related to me.

We should have now this:

CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from);

in production, otherwise it would have problems with not using the index.

Paging a sorted categorylinks was pretty broken here anyway.

(In reply to comment #7)

We should have now this:

CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks
(cl_to,cl_type,cl_sortkey,cl_from);

in production, otherwise it would have problems with not using the index.

Paging a sorted categorylinks was pretty broken here anyway.

Good point.