Page MenuHomePhabricator

Make probabilistic write to cuci_user disable-able via a config variable
Closed, ResolvedPublic1 Estimated Story Points

Description

Currently, when writing to cuci_user within a minute of the last write we debounce, and within an hour we debounce 90% of the time (writing 10% of the time).

This makes testing difficult as I cannot always distinguish between a write which failed due to a bug and a write which failed because it was one of the 90%.

My suggestion:

  • remove the probabilistic debounce within an hour
  • have the one minute debounce turned in to a config variable, which we default to 1 hour

I am assuming that, if we are OK with only 10% of events being recorded within an hour, then we are OK with none of them being recorded.

Open question: should the debounce time for cuci_temp_edit be controlled by the same config variable?

Event Timeline

I am assuming that, if we are OK with only 10% of events being recorded within an hour, then we are OK with none of them being recorded.

I'm not sure that this assumption holds AFAIK. Essentially, this random chance for editing helps avoid infrequent updates for high-edit rate users without having to update the timestamp every minute.

should the debounce time for cuci_temp_edit be controlled by the same config variable?

Perhaps, but per DBAs comments in T368151#9993273 the hour limitation was only really necessary for writes to cuci_user. For CheckUser-GlobalContributions, only updating the timestamp every hour for users who edit over multiple wikis and quickly might not be fast enough.


My alternative suggestion would be to add configuration that allows disabling the existing hour check or allows specifying how long the time period should be. When the config is set to disable the hour check the random chance is disabled too.

That config would be set to 1 hour by default, or (if preferred) only set to an hour on WMF wikis and by default set to disable.

Dreamy_Jazz renamed this task from Remove probabilistic write to cuci_user and make debounce time a config variable to Make probabilistic write to cuci_user disable-able via a config variable.Sep 12 2024, 11:52 AM

Change #1072522 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Add wgCheckUserCuciUserRandomChanceDebounceCutoff

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

Change #1072522 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add wgCheckUserCuciUserRandomChanceDebounceCutoff

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

Tested as part of other work. When I set $wgCheckUserCuciUserRandomChanceDebounceCutoff = false; the debounce time is 1 minute.