Page MenuHomePhabricator

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


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.


Event Timeline

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?

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