[SERVER-5733] mongos --chunkSize does not update chunkSize setting Created: 01/May/12  Updated: 14/May/14  Resolved: 01/May/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.0, 2.1.0
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Remon van Vliet Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: chunks, sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Issue Links:
Duplicate
duplicates SERVER-5735 Add sh.set/getGlobalChunkSize() helper Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

When starting mongos with a specific value for the --chunkSize parameter this parameter will be ignored if there's already a chunkSize setting in config.settings. This basically means there's no officially supported way to change the chunkSize setting. I can certainly think of a few cases where MongoDB shouldn't allow this value to be modified but there are some valid use cases.

Would it be possible to always respect the --chunkSize setting and error out if the setting is invalid for whatever reason? Or even better add an admin command for it. I've already run into a number of cases where I'd like different chunksizes for different collections for example so an additional (optional) parameter to the "shardCollection" command might be a good route to take.



 Comments   
Comment by auto [ 13/Jun/12 ]

Author:

{u'date': u'2012-06-13T08:22:23-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: SERVER-5733 chunkSize documentation regarding changing chunk size
Branch: master
https://github.com/mongodb/docs/commit/026184ab9e43d89d11b372203e1bf3d1c9f1d21f

Comment by Remon van Vliet [ 01/May/12 ]

Hi,

Well frankly I don't think MongoDB should even allow writes to the config database directly from the shell to begin with. There needs to be a way for mongo to error out if invalid settings are provided and you can't do that if you allow things like db.settings.update({_id:"chunkSize"}, {$set:{value:10}}). Basically all mutations to the config database collections should go through admin only shell commands that can do the appropriate checks and such.

But that said I think it's still better to either error when it's already set or allow --chunkSize to basically always do the update mentioned above. I can't think of any arguments against that approach anyway.

Comment by Scott Hernandez (Inactive) [ 01/May/12 ]

The way to change the chunk size is to make changes to the config db settings collection. We can add a help in the shell for this – I'll change this issue to that.

We can change the docs to better indicate --chunkSize is only for setting the initial size.

There are already other issues which cover setting a chunk size per collection.

Generated at Thu Feb 08 03:09:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.