Last modified: 2014-09-11 18:34:37 UTC
There seems to be a missing "concurrent" test/protection during automatic account creation (with SUL) when one connects on a new wikimedia wiki. If one open not one but 2 pages (in a tiny interval, like one second or less) on that wiki, -the first one will cause the account to be created (normal behaviour) -the 2nd one will show an error of the like of : the following error occurs : richiamata dalla funzione "User::addToDatabase". MySQL ha restituito il seguente errore "1062: Duplicate entry 'Darkoneko' for key 2 (10.0.6.21)". I assume it's because the 2nd page doesn't detect that the 1st is already running the "account creation" thing. ---- The error message above was copied from napwiki (case happened some minutes ago) ; I also had the same case on another wikimedia wiki (forgot which) yesterday
I expect this is because the relevant functions check a slave DB to see if the user already exists, but creating the new user account if it doesn't involves writing to the DB master. So instance one checks a slave, sees no account, and writes a new user into the master 'user' table. Instance two checks a slave, which hasn't yet synced with the master and so *still* shows no account, tries to write the *same* new user into the master 'user' table, and MySQL quite rightly stops that happening. Presumably you could get the same result with just about any read/write-if-not-found action. Probably no way to avoid this except by doing the initial read on the DB master as well, which rather defeats the object of having a replicated database in the first place :D
Updating product/component.
*** This bug has been marked as a duplicate of bug 16020 ***