]> source.dussan.org Git - nextcloud-server.git/commit
Create the database user in a transaction 35561/head
authorThomas Citharel <tcit@tcit.fr>
Fri, 2 Dec 2022 16:46:37 +0000 (17:46 +0100)
committerJulius Härtl (Rebase PR Action) <github@juliushaertl.de>
Wed, 15 Mar 2023 11:07:07 +0000 (11:07 +0000)
commitf7e65b17513303bd16308107d252682ac3c56359
tree5971ea0bfdd8a2c4364d5d70f16dc7aa85e8bf5c
parent8568c11d24736d4df1b9781c4121cf7165f40f65
Create the database user in a transaction

In OC\User\Manager::createUserFromBackend the newly created user is read
using getUserObject($uid, $backend) but that can cause causal read
issues (wrote in DB primary, not yet in secondary).

In OC\User\Database user backend the user cache is unset after the
insert, so it can't be used by getRealUID() (which is called by
getUserObject()).

To avoid that we make sure the user cache is repopulated in a
transaction.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
lib/private/User/Database.php