Rajkishore Singh
unread,Mar 1, 2012, 8:05:27 AM3/1/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi all,
I am getting some error at random time....
Error:
URL /root/recoly/crons/send_mailer.php 1 Uncaught exception
'MongoCursorException' with message 'setShardVersion failed host:
x.x.x.x:10011 { oldVersion: Timestamp 0|0, ns: "recommendly.pages",
version: Timestamp 3000|0, globalVersion: Timestamp 2000|0, errmsg:
"client version differs from config's for collection
'recommendly.pages'", ok: 0.0 }' in /root/recoly/crons/send_mailer.php:
21 Stack trace: #0 /root/recoly/crons/send_mailer.php(21): MongoCursor-
>rewind() #1 {main} thrown in /root/recoly/crons/send_mailer.php:21
we are using Sharded Mongo with 3 replicaset, 3 config server & 5-10
mongos(we are runing one mongos on each machine from where we are
accessing mongo). so, currently we have 8 mongos on 8 different
machine.
as per given in the error msg that we get error at line no 21,
Here some partial code of that file
Line No: 17 $pages = $pages_model->find(array('status' => 4,
'is_active' => 1, 'mail_time' => array('$gte'=> $min, '$lt'=> $max),
'subscribed' => 1));
LNo: 18 //$pages = $pages_model->find(array('status' => 4, 'id' =>
'249343554283')); // for testing
LNo: 19 $pages_count = $pages->count();
LNo: 20 if($pages_count > 0) {
LNo: 21 foreach ($pages as $page) {
LNo: 22 var_dump($page);
LNo: 23 $stats = Load::Library('mailerStats', array('page_id'
=> $page['id'], 'user_id' => $page['user_id']));
LNo: 24 $stats->dataExists($page);
LNo: 25 $stats->sendEmail($page);
LNo: 26 }
LNo: 27 }
Shard key of the collection which is pointed by $pages_model is "id".
can any body tell me, what could be the reason for the above error
msg...
as we can see in line no 17, I am not using shard_key in find
query....so, will this is reason for this error. but some times we get
error some time not.
generally we get 2-3 times in 24 hrs...
please reply...
Thanks
Raj