Page MenuHomePhabricator

Revision::insertOn() fails due to a race condition if the page was created in the same request
Closed, InvalidPublic

Description

If you create a page, then, in the same request, call Revision::insertOn() (or perform an action, such as protecting the page, that calls that method) an exception is thrown. This happens because Revision::insertOn() calls Revision::checkContentModel(), which ends up checking content queried from replica databases, and the replicas don't yet have the new page's content.

It seems this is the cause of T146880.

Thanks!!

Event Timeline

AndyRussG created this task.Oct 7 2016, 3:03 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 7 2016, 3:03 AM
Tgr added a subscriber: Tgr.Oct 7 2016, 3:21 AM

Without being familiar with the code (so it's probably bad advice :) it seems like Revision::newNullRevision should set mQueryFlag to READ_LATEST since it always represents master state?

AndyRussG updated the task description. (Show Details)Oct 7 2016, 3:25 AM

Ooooh looks like this may have been solved by https://gerrit.wikimedia.org/r/#/c/314479/ (T138310). Checking...

Yep, looks like this was just fixed! T146880 is no longer reproducible on the beta cluster... Thx, @Tgr for the tip!!

AndyRussG closed this task as Invalid.Oct 7 2016, 4:13 AM