Summary
Record whether a user has any global edits in the GetSecurityLogContext hook, so this information is available for filtering in Logstash.
Technical notes
A previous attempt (630fa7c282bb1687a44e3fd8778a6f3fbb9e7df7) was reverted because it caused deadlocks during login (T416637). CentralAuthEditCounter::getCount() can fall through to the primary DB and perform INSERT+UPDATE on global_edit_count when no row exists for a user. This write path caused deadlocks when called from the GetSecurityLogContext hook.
The fix adds a $readOnly parameter to getCount(). When true, only the replica DB is queried and null is returned if no row exists, avoiding any writes. The user_has_edits_global context field is only set when the count is available.
Acceptance criteria
- user_global_edit_count is included in security log context when the global edit count row exists
- No writes to the database occur during the GetSecurityLogContext hook