exception: [test.collection] shard version not ok in Client::Context:

314 views
Skip to first unread message

Martinus Martinus

unread,
Mar 1, 2012, 10:26:41 PM3/1/12
to mongod...@googlegroups.com
Hi,

When I run my map reduce I got this error message from the log :

exception: [test.collection] shard version not ok in Client::Context: your version is too old  ns: test.collection global: 6|0 client: 5|1 code:13388 reslen:236 3526ms

What this error supposed to mean and how to fix this problem?

Thanks.

gregor

unread,
Mar 2, 2012, 6:07:20 AM3/2/12
to mongod...@googlegroups.com
This means that the sharding cache that mongos is holding is stale - is there any other logging after this to show that the stale cache is being refreshed?
Take a look at this

Martinus Martinus

unread,
Mar 5, 2012, 1:36:11 AM3/5/12
to mongod...@googlegroups.com
Hi Gregor,

When I run my map/reduce code on the first time it's ok, but when I run it again, it will generate those message. What does message mean? and what should I do to fix this?

Thanks.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/gTAPZPoMp7kJ.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

gregor

unread,
Mar 5, 2012, 12:06:37 PM3/5/12
to mongod...@googlegroups.com
Hi
Probably what is happening is that because map/reduce is such a long running query, the cache is getting stale. 

The workaround is to run flushRouterConfig and retry the map/operation. 
If you want to do this from the shell see 

Or you could catch the exception in code and run flushRouterConfig from there. 

This issue is fixed in the 2.2.0 release - see 

You could get a nightly build with the fix in it if you prefered. 

Gregor


Martinus Martinus

unread,
Mar 5, 2012, 9:20:26 PM3/5/12
to mongod...@googlegroups.com
Hi Gregor,

Thanks for your information. After I getting the same error message on the log, I stop my primary node on shard replica sets and started it again, so the primary changed into another node and I run the map/reduce code again without problem.

Thanks.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/xrfrqmQU8ncJ.

Martinus Martinus

unread,
Mar 13, 2012, 11:41:12 PM3/13/12
to mongod...@googlegroups.com
Hi,

If I running my map/reduce over and over again it will suddenly stopped and get me into this error message :

Exception in thread "main" com.mongodb.CommandResult$CommandFailure: command failed [command failed [mapreduce] { "cause" : { "assertion" : "[test.collection] shard version not ok in Client::Context: client in sharded mode, but doesn't have version set for this collection: test.collection myVersion: 25|0" , "assertionCode" : 13388 , "errmsg" : "db assertion failure" , "ok" : 0.0} , "ok" : 0.0 , "errmsg" : "mongod mr failed: { assertion: \"[test.collection] shard version not ok in Client::Context: client in sharded mode, but doesn't have version set for this collection: test.collection...\", assertionCode: 13388, errmsg: \"db assertion failure\", ok: 0.0 }"}

How do I fix this problem?

Thanks.

Eliot Horowitz

unread,
Mar 17, 2012, 3:14:36 AM3/17/12
to mongod...@googlegroups.com
What version is that error message with?

Martinus Martinus

unread,
Mar 18, 2012, 10:57:30 PM3/18/12
to mongod...@googlegroups.com
Hi Eliot,

The MongoDB version is 2.0.3.

Thanks.

gregor

unread,
Mar 29, 2012, 4:18:12 PM3/29/12
to mongod...@googlegroups.com
can you 

use test
db.collection.getShardVersion()

>>> For more options, visit this group at
>>> http://groups.google.com/group/mongodb-user?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to

> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.

Martinus Martinus

unread,
Apr 1, 2012, 11:08:03 PM4/1/12
to mongod...@googlegroups.com
Hi Gregor,

it gave me this in return : { "version" : { "t" : 33000, "i" : 1 }, "ok" : 1 }

Thanks.

To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/fe3MHwYZoeYJ.

To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

gregor

unread,
Apr 2, 2012, 10:13:53 AM4/2/12
to mongod...@googlegroups.com
Can you upload a log file somewhere for me to look at? 
To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.

Martinus Martinus

unread,
Apr 16, 2012, 11:05:28 PM4/16/12
to mongod...@googlegroups.com
Hi Gregor,

In my log it gaves me this message :

Tue Apr 17 11:02:57 [conn33488] mr failed, removing collection :: caused by :: 13388 [test.collection] shard version not ok in Client::Context: client in sharded mode, but doesn't have version set for this collection: test.collection myVersion: 22|1

Thanks.

To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/n-IA6ZFGDRgJ.

To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

gregor

unread,
Apr 17, 2012, 10:49:47 AM4/17/12
to mongod...@googlegroups.com
Can you try flushRouterConfig and see if this fixes it please?
To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.

Martinus Martinus

unread,
Apr 17, 2012, 11:04:48 PM4/17/12
to mongod...@googlegroups.com
Hi Gregor,

Yes it is. Thanks for your answer. So before we do map/reduce we need to do flushRouterConfig every time?

Thanks.

To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/A6KYWgK1HMsJ.

To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

gregor

unread,
Apr 18, 2012, 3:52:11 AM4/18/12
to mongod...@googlegroups.com
With long running queries yes - until the 2.2.0 release where it is fixed. 


Martinus Martinus

unread,
Apr 18, 2012, 5:45:56 AM4/18/12
to mongod...@googlegroups.com
Hi Gregor,

Thanks for your answer. When will this Mongo 2.2.0 be released?

Thanks.

On Wed, Apr 18, 2012 at 3:52 PM, gregor <gre...@10gen.com> wrote:
With long running queries yes - until the 2.2.0 release where it is fixed. 

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/Y7BV9_Ms2MkJ.

gregor

unread,
Apr 18, 2012, 5:54:46 AM4/18/12
to mongod...@googlegroups.com
Currently we are targeting code freeze for end of May. 

Martinus Martinus

unread,
Apr 24, 2012, 4:39:38 AM4/24/12
to mongod...@googlegroups.com
Hi Gregor,

I'm doing the map/reduce on the collection that still on balancing process and it gave me the same error again even though I have used the flushRouterConfig before I did the map/reduce. Do I need to wait until all the chunks got balanced in the shards before I do map/reduce?

Thanks.

On Wed, Apr 18, 2012 at 5:54 PM, gregor <gre...@10gen.com> wrote:
Currently we are targeting code freeze for end of May. 

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/Q60xFoPDR1gJ.

gregor

unread,
Apr 30, 2012, 11:19:54 AM4/30/12
to mongod...@googlegroups.com
What you could perhaps do is turn of balancing while you wait for the map/reduce. Or take a nightly build where this should be fixed. Or wait for 2.2!


On Tuesday, April 24, 2012 9:39:38 AM UTC+1, Martinus Martinus wrote:
Hi Gregor,

I'm doing the map/reduce on the collection that still on balancing process and it gave me the same error again even though I have used the flushRouterConfig before I did the map/reduce. Do I need to wait until all the chunks got balanced in the shards before I do map/reduce?

Thanks.

On Wed, Apr 18, 2012 at 5:54 PM, gregor <gre...@10gen.com> wrote:
Currently we are targeting code freeze for end of May. 


--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/Q60xFoPDR1gJ.

To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages