Page MenuHomePhabricator

[Beta Cluster] "Targets passed" entry not created until one edit after the target is met
Closed, ResolvedPublicBUG REPORT

Description

The targets passed entry should be created immediately after a target count is met, but on the Beta Cluster, is not created until after the next edit.

Steps to Reproduce: Make five qualifying edits, check the wikimedia_editor_tasks_targets_passed table, then make a sixth and check it again.

Expected Results: The targets_passed entry is populated immediately after the fifth edit.

Actual Results: The targets_passed entry is populated immediately after the sixth edit.

(Note: Bug does not occur in a local MW-Vagrant environment.)

Event Timeline

@Tgr Any idea offhand what could be going on here? I can't even come up with a good theory.

Seems like there is a race between the db replicas getting the incremented value and the PHP code reading from a replica to get the updated value. Might have to update to read from master to evaluate targets passed after incrementing.

Confirmed that this ^ is what's happening. Reading from DB_MASTER in the follow-up query fixes the issue.

Change 498963 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/extensions/WikimediaEditorTasks@master] Fix: Read counts from DB_MASTER when updating targets_passed

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

Change 498963 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEditorTasks@master] Fix: Use READ_LOCKING when evaluating whether to update targets_passed

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

Change 499544 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/extensions/WikimediaEditorTasks@wmf/1.33.0-wmf.23] Fix: Use READ_LOCKING when evaluating whether to update targets_passed

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

Change 499544 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEditorTasks@wmf/1.33.0-wmf.23] Fix: Use READ_LOCKING when evaluating whether to update targets_passed

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