[DOCS-7353] Document limited circumstances for writing to the configdb Created: 07/Mar/16  Updated: 30/Oct/23  Resolved: 30/Mar/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Kevin Pulo Assignee: Steve Renaker (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 7 years, 46 weeks ago

 Description   

The docs at https://docs.mongodb.org/manual/reference/config-database/ state:

IMPORTANT
Consider the schema of the config database internal and may change between releases of MongoDB. The config database is not a dependable API, and users should not write data to the config database in the course of normal operation or maintenance.

WARNING
Modification of the config database on a functioning system may lead to instability or inconsistent data sets. If you must modify the config database, use mongodump to create a full backup of the config database.

While all of this is true, there is one situation where it is acceptable to write to the config db. This is the case of doing a test write to unused collection in order to verify the write availability of the config servers. For example, running the following on a mongos:

db.getSiblingDB("config").testConfigServerWriteAvail.update( { _id: 1 }, { $inc: { a: 1 } }, { upsert: true } )

If this succeeds, the the config servers are up and able to successfully process writes. If this fails, then they are not.

Since the collections in the config db may change over time (ie. future releases of the server may use collections that older versions do not), users wishing to do this must choose the name of test-write collection very carefully to avoid any potential collisions in the future (hence "testConfigServerWriteAvail" in the example above).

It is still never acceptable under any circumstances to store any general-purpose user data in the config db, since that's not its intended purpose and it hasn't been designed for such a use case.



 Comments   
Comment by Githook User [ 30/Mar/16 ]

Author:

{u'username': u'steveren', u'name': u'Steve Renaker', u'email': u'steve.renaker@mongodb.com'}

Message: DOCS-7353: moved warning about modifying config db

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/360e5afbad197701b814bf126b996667e9b71cb8

Comment by Githook User [ 30/Mar/16 ]

Author:

{u'username': u'steveren', u'name': u'Steve Renaker', u'email': u'steve.renaker@mongodb.com'}

Message: DOCS-7353: new wording for writing to a test collection in config db

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/e03d215650a77b8a3a33ada25adb030d23b9b1f7

Comment by Githook User [ 30/Mar/16 ]

Author:

{u'username': u'steveren', u'name': u'Steve Renaker', u'email': u'steve.renaker@mongodb.com'}

Message: DOCS-7353: changed wording of "Important" box

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/9231aff216f8999c27b32e63405cfcac84e32f30

Comment by Githook User [ 30/Mar/16 ]

Author:

{u'username': u'steveren', u'name': u'Steve Renaker', u'email': u'steve.renaker@mongodb.com'}

Message: DOCS-7353: limited circumstances for writing to the config db

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/bb03861f849aaea01de96915b2d6fe32824b7717

Generated at Thu Feb 08 07:54:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.