Hello everyone, same problem here.
Running MongoDB 6.0.21 from TAR archive (on Debian 11 in case it matters),
fsyncLock() worked correctly via mongos, but I cannot unlock the db:
superadmin@admin || REMOTE => db.fsyncUnlock()
MongoServerError[Unauthorized]: not authorized on admin to execute command { fsyncUnlock: 1, lsid: { id: UUID("1e47fd83-9d0f-4085-a067-3ef9124df008") }, $clusterTime: { clusterTime: Timestamp(1746603456, 1), signature: { hash: BinData(0, 80792718E59049D81365EAC9C57D8A3F1AF64A66), keyId: 7501307811511402521 } }, $db: "admin" }
The user I’m using to issue the command has the current roles:
db.runCommand({ connectionStatus: 1 })
{
authInfo: {
authenticatedUsers: [ { user: 'superadmin', db: 'admin' } ],
authenticatedUserRoles: [
{ role: 'clusterAdmin', db: 'admin' },
{ role: 'dbAdminAnyDatabase', db: 'admin' },
{ role: 'hostManager', db: 'admin' },
{ role: 'readWriteAnyDatabase', db: 'admin' },
{ role: 'root', db: 'admin' },
{ role: 'userAdminAnyDatabase', db: 'admin' }
]
},
ok: 1,
.....
}
I’ve successfully unlocked the database by running db.fsyncUnlock() on the primary nodes of the 2 shards,
but according to MongoDB documentation db.fsyncUnlock() - Database Manual v8.0 - MongoDB Docs
it should be possible to lock and unlock connecting via mongos:
Starting in MongoDB 7.1 (also available starting in 7.0.2, 6.0.11, and 5.0.22) the db.fsyncLock() and db.fsyncUnlock() methods can run on mongos to lock and unlock a sharded cluster.
Is this a bug?
It would be nice to have the db.fsyncUnlock() properly working via mongos to ease the backup process.
Thank you for any hint,
_
Fabio