Page MenuHomePhabricator

[Task] only fallback to master in WikiPageEntityMetaDataLookup when explicitly requested
Closed, ResolvedPublic

Description

WikiPageEntityMetaDataLookup should only fallback to master when EntityRevisionLookup::LATEST_FROM_MASTER is explicitly set. (in cases where we need to be concerned about slave lag)

In many cases, if there is some slave lag, it is okay. (e.g. accessing an entity from lua)

see T108841

Event Timeline

aude raised the priority of this task from to High.
aude updated the task description. (Show Details)
aude subscribed.
aude renamed this task from only fallback to master in WikiPageEntityMetaDataLookup when EntityRevisionLookup::LATEST_FROM_MASTER is explicitly set [Task] to only fallback to master in WikiPageEntityMetaDataLookup when explicitly requested [Task].Aug 13 2015, 10:46 AM
aude set Security to None.
aude renamed this task from only fallback to master in WikiPageEntityMetaDataLookup when explicitly requested [Task] to [Task] only fallback to master in WikiPageEntityMetaDataLookup when explicitly requested.Aug 13 2015, 10:56 AM

Just to give a short update here: I poked at this and there is a "draft" on gerrit… the "hard" part is to make sure all code paths use the right type of connection (master for writes, slaves otherwise) and we have the appropriate fallbacks in place if needed.

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

I'll have another look at this sometime soon.

Has anyone had a chance to look at this lately?

The patch doesn't seem to load for me.

FYI: I just picked this up again and will probably provide patches during this weekend… I'll do it step by step to minimize the risk of us introducing data inconsistencies this way.

Change 302199 had a related patch set uploaded (by Hoo man):
Introduce EntityRevisionLookup::LATEST_FROM_SLAVE_WITH_FALLBACK

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

Todo (mostly a note to myself):

  • Change EntityRevisionLookup::getEntityRevision to a signature like EntityRevisionLookup::getEntityRevision( $entityId, $revisionIdOrMode, $mode )
  • Find all places where we might want to use fallbacks (PS1 from https://gerrit.wikimedia.org/r/279135 (draft) indicates most(?) places)
  • Change the default to slave only

Change 302199 merged by jenkins-bot:
Introduce EntityRevisionLookup::LATEST_FROM_SLAVE_WITH_FALLBACK

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

@hoo This can be closed now, right?

Change 279135 merged by jenkins-bot:
Don't fallback to master in WikiPageEntityMetaDataLookup etc.

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

hoo removed a project: Patch-For-Review.