[SERVER-21146] Issuing moveChunk/mergeChunk/splitChunk, setShardVersion, _recvChunkStart on mongod can cause server hang Created: 26/Oct/15  Updated: 25/Apr/16  Resolved: 11/Nov/15

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.0-rc0
Fix Version/s: 3.2.0-rc3

Type: Bug Priority: Major - P3
Reporter: Robert Guo (Inactive) Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: fuzzer-blocker
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-21318 Non internal user can execute moveChu... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding B (10/30/15)
Participants:
Linked BF Score: 0

 Description   

On a single instance mongod, each of the 5 commands checks for the existence of the "config" or "configdb" field in the command object. If it exists and is a string, then shardingState is set to initializing in ShardingState::initialize. However the initialization never succeeds and the InitializationState is left in "initializing". Which causes calls to while loops waiting on initializationState to never exit:

while (_getInitializationState() == InitializationState::kInitializing) {
            _initializationFinishedCondition.wait(lk);
}

This affects subsequent calls to move/merge/splitChunk, setShardVersion, _recvChunkStart and shutdown



 Comments   
Comment by Githook User [ 11/Nov/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-21146 Fix duplicate fassert code
Branch: master
https://github.com/mongodb/mongo/commit/1ea7a57bc3fcda0cf83f78fa6be2a769913cd7b1

Comment by Githook User [ 11/Nov/15 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-21146 Add sharding state initialization error state

This change introduces a kError state to the sharding state so that it can
be used for the cases where initialization fails instead of leaving the
sharding state in the initializing state.
Branch: master
https://github.com/mongodb/mongo/commit/7a369c3f57b57762fd689bb1301c5c4424abba8a

Comment by Misha Tyulenev [ 05/Nov/15 ]

SERVER-21318 addresses internal user privileges requirement.

Comment by Misha Tyulenev [ 05/Nov/15 ]

Agree, reopened

Comment by Spencer Brody (Inactive) [ 04/Nov/15 ]

misha.tyulenev, I think it's misleading to mark this ticket as fixed as we didn't actually fix the hang, just restricted the ability to hit it if using access control. Instead could you re-open this one but add a new ticket describing the access control change that was made and close that one?

Comment by Githook User [ 03/Nov/15 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-21146 restrict splitChunk, moveChunk, mergeChunks on mongod to internal user only
Branch: master
https://github.com/mongodb/mongo/commit/730e2cfca84134d1564fb80d851a42cc17ebcdb3

Comment by Robert Guo (Inactive) [ 02/Nov/15 ]

_recvChunkStart and setShardVersion are similarly affected. I will update the ticket description to reflect this change.

Comment by Spencer Brody (Inactive) [ 28/Oct/15 ]

misha.tyulenev, as part of this, can you please update the required privileges for the mongod versions of the commands to require internal user privileges so general end-users can't run the mongod version directly? You can do this by modifying the 'checkAuthForCommand' method in the Command definition.

Comment by Spencer Brody (Inactive) [ 26/Oct/15 ]

This looks like a regression, so we should try to fix this before 3.2

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