Reputation: 2786
In my config.locks collection after unsucessfull migration to 2.4 version I have document like this:
{
"_id" : "configUpgrade",
"process" : "mongo10:27017:1369289803:1804289383",
"state" : 1,
"ts" : ObjectId("519db44b8436a4e1aa17b0a5"),
"when" : ISODate("2013-05-23T06:16:43.075Z"),
"who" : "mongo10:27017:1369289803:1804289383:mongosMain:846930886",
"why" : "upgrading config database to new format v4"
}
What does it mean state 1? I know that valid values for 'state' are 0,1 and 2. What each of them means?
Upvotes: 2
Views: 1365
Reputation: 26
The value in the state field indicates that a mongos has the lock. For version 2.0 and later, the value of an active lock is 2; for earlier versions the value is 1. src: http://docs.mongodb.org/manual/tutorial/manage-sharded-cluster-balancer/
Upvotes: 1
Reputation: 36784
http://docs.mongodb.org/manual/reference/config-database/#config.locks states:
If a mongos holds the balancer lock, the state field has a value of 2, which means that balancer is active. The when field indicates when the balancer began the current operation.
Only through the source (https://github.com/mongodb/mongo/blob/master/src/mongo/s/type_locks.h#L231) I can find out what state 1 means:
int _state; // (M) 0: Unlocked | 1: Locks in contention | 2: Lock held
From what I understand, this is used to upgrade locks between the 2.2 and 2.4 versions of MongoDB.
Upvotes: 1