Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11936

WriteConcern format for _secondaryThrottle is incorrect

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: Server
    • Labels:
      None

      ----------------------------

      Original Description

      Here in the documentation we have the following example:

      use config
      db.settings.update(
         { "_id" : "balancer" },
         { $set : { "_secondaryThrottle" : true ,
                    "writeConcern": { "w": "majority" } } },
         { upsert : true }
      )
      

      This is in fact incorrect - write concern, if set that way, will not take effect. The correct way to set it is:

      use config
      db.settings.update(
         { "_id" : "balancer" },
         { $set : { "_secondaryThrottle" : { "w": "majority" } } },
         { upsert : true }
      )
      

      So the resulting document would look like:

      MongoDB Enterprise mongos> db.getSiblingDB("config").settings.findOne()
      {
      	"_id" : "balancer",
      	"stopped" : false,
      	"mode" : "full",
      	"_secondaryThrottle" : {
      		"w" : "majority"
      	}
      }
      

      ----------------------------

      Description

      Scope of changes (files that need work and how much)

      Impact to other docs outside of this product

      MVP (work and date?)

      Resources (e.g. Scope Docs, Invision)

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:
              5 years, 37 weeks, 6 days ago