To prevent performance degradation caused by the locking of the admin system database, ApsaraDB for MongoDB released MongoDB 7.0.4 whose kernel version is MongoDB 6.0 on January 10, 2024. The root account of ApsaraDB for MongoDB instances that run MongoDB 7.0.4 or later no longer has write permissions on the admin system database. For more information about administrative commands that lock a database , see Which administrative commands lock a database? If the minor version of your instance ranges from MongoDB 7.0.0 to MongoDB 7.0.3, migrate data from the admin system database to a custom database at your earliest opportunity. Otherwise, you may fail to write data to the admin system database after you update the minor version of the instance.
Content
The root account of ApsaraDB for MongoDB instances that run MongoDB 7.0.4 or later has only read permissions on the admin system database but no longer has write permissions on the database. In addition, the root account can no longer create an account that has write permissions on the database.
Scope of impacts
ApsaraDB for MongoDB instances that run MongoDB 6.0 whose kernel version ranges from MongoDB 7.0.0 to MongoDB 7.0.3.
Impacts
If your data is stored in the admin system database, all write operations on the database fail after you update the minor version of the instance to MongoDB 7.0.4 or later.
To prevent this issue, you can refer to the following example to rename a collection to a custom database. In this example, the custom database is named mydb.
This example is applicable only to the mongo shell.
db.getSiblingDB('admin').getCollectionNames().forEach(function(collectionName) {
if (!collectionName.startsWith('system.')) {
db.getSiblingDB('admin').adminCommand({
renameCollection: 'admin.' + collectionName,
to: 'mydb.' + collectionName
});
}
});