Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SlaveOk queries doesn't seems to go through mongoS
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 34 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Simon T.  
View profile  
 More options Mar 19 2012, 4:04 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Mon, 19 Mar 2012 13:04:11 -0700 (PDT)
Local: Mon, Mar 19 2012 4:04 pm
Subject: SlaveOk queries doesn't seems to go through mongoS

Hi guys,

My Mongo cluster is setupped this way:

- 2 mongos
- 2 shards
- 1 master/2 secondaries per shard

I'm using the Java drivers and the C# drivers.

With both drivers whenever I make a query when connecting through a mongoS
with the slaveOk parameters, it's always the Master of each shard that
anwser, never the secondaries.

However, I tested with the C# drivers, if I connect directly through one
replica set with the SlaveOk option, it works fine.

To enable the SlaveOk property, I use the connection string
ie."mongodb://server/?slaveOk=true" to tell the drivers I want the slave Ok
option. When debugging I can see in my MongoServerSettings object that its
SlaveOk property is set to true.

Currently, through mongos, it does not working either with the java drivers
nor the C# drivers, and I've also tried the python drivers and its not
working.

Is there something specific I need to check or config to make it happened ?
Like I said earlier: it does work when connecting directly to the replica
set. When I debug using the replica set, I see the 3 servers instance and
the drivers know which server is the master and which one are the
secondaries. But what happens when those servers sit behind a mongos ?
Since the drivers don't know anything about the servers behind the mongos,
the mongos need to do the dispatch for the SlaveOk to work correctly. So is
there any special configuration required for the mongos to make the SlaveOk
work properly ?

Thanks

Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 19 2012, 4:42 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Mon, 19 Mar 2012 13:42:53 -0700 (PDT)
Local: Mon, Mar 19 2012 4:42 pm
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

I forgot to mention that I'm using C# drivers 1.3.1 (latest as of now, I
believe) and our servers are 2.0.3.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Mar 19 2012, 5:34 pm
From: Kristina Chodorow <krist...@10gen.com>
Date: Mon, 19 Mar 2012 14:34:04 -0700 (PDT)
Local: Mon, Mar 19 2012 5:34 pm
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

What makes you think that mongos isn't dispatching these queries to the
secondaries?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 20 2012, 9:54 am
From: "Simon T." <simon.tou...@gmail.com>
Date: Tue, 20 Mar 2012 06:54:18 -0700 (PDT)
Local: Tues, Mar 20 2012 9:54 am
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

If I fire 30k requests to the mongos. When watching the mongostat of each
server, I see that its always the master of each shard that is anwsering
and none of the secondaries.

Since all the drivers can see is the mongos to whom it is connected, and
its SlaveOk setting is set to "true". I assume that it's the mongos that
did not forward the queries to the replica set with the mention "SlaveOk =
true".


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Mar 20 2012, 11:23 am
From: Kristina Chodorow <krist...@10gen.com>
Date: Tue, 20 Mar 2012 08:23:31 -0700 (PDT)
Local: Tues, Mar 20 2012 11:23 am
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

Hmm, can you run mongostat --discover for a few minutes while you do some
queries and then send its output + mongos log from that time?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 20 2012, 12:31 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Tue, 20 Mar 2012 09:31:24 -0700 (PDT)
Local: Tues, Mar 20 2012 12:31 pm
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

Thanks for your help Kristina.

Attached to this message is a .tar file with the mongostat -discover output
and the mongos log.  The test started around 16:07:05 so you can scroll
down to that part.

Thank you very much again.

Simon

  mongodebug.tar
355K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 20 2012, 12:35 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Tue, 20 Mar 2012 09:35:35 -0700 (PDT)
Local: Tues, Mar 20 2012 12:35 pm
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

By the way, I'm aware of the issue with the server 1 and 3 on shardB.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Mar 20 2012, 3:11 pm
From: Kristina Chodorow <krist...@10gen.com>
Date: Tue, 20 Mar 2012 12:11:33 -0700 (PDT)
Local: Tues, Mar 20 2012 3:11 pm
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

Thanks for the info, this is weird and I haven't been able to reproduce.
 As a sanity check, can you try this in the shell:  

> // connect to mongos
> db.getMongo().setSlaveOk()
> db.collectionYouAreQueryingFromC#.find(/* somequery */).explain()

...and send the output?  (Replacing collectionYouAreQueryingFromC# and /*
somequery */ :) )


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 21 2012, 10:51 am
From: "Simon T." <simon.tou...@gmail.com>
Date: Wed, 21 Mar 2012 07:51:02 -0700 (PDT)
Local: Wed, Mar 21 2012 10:51 am
Subject: Re: SlaveOk queries doesn't seems to go through mongoS

Hi Kristina,

here is the output of the shell after doing the query with the explain()
function:

mongos> db.getMongo().setSlaveOk()
mongos> db.players.find({"s_nintendoID":"250000"}).explain()
{
        "cursor" : "BtreeCursor idx_nintendoID",
        "nscanned" : 1,
        "nscannedObjects" : 1,
        "n" : 1,
        "millis" : 0,
        "nYields" : 0,
        "nChunkSkips" : 0,
        "isMultiKey" : false,
        "indexOnly" : false,
        "indexBounds" : {
                "s_nintendoID" : [
                        [
                                "250000",
                                "250000"
                        ]
                ]
        }

}

mongos>

Here is the output of mongostat, stating that it is a master (osmngb01)
that did answer again:

osmnga01:27018       0      0      0      0       2       1       1  
276g   555g  58.4g      0        0          0       0|0     2|1   156b    
1k    27 sharda    M   14:48:54
osmnga02:27018      *0     *0     *0     *0       0     2|0       0  
276g   553g  56.3g      0        0          0       0|0     0|0   188b    
1k     9 sharda  SEC   14:48:54
osmnga03:27018      *0     *0     *0     *0       0     3|0       0  
276g   553g  3.11g      0        0          0       0|0     0|0   314b    
1k     9 sharda  SEC   14:48:54
osmngb01:27018       0      1      0      0       0       6       0  
311g   623g   141g      0        0          0       0|0     2|0   532b    
2k    33 shardb    M   14:48:54
osmngb02:27018      *0     *0     *0     *0       0     2|0       0  
362g   727g   103g      0        0          0       0|0     0|0   188b    
1k     8 shardb  SEC   14:48:54
osmngb03:27018      *0     *0     *0     *0       0     2|0       0  
311g   623g   109g      0        0          0       0|0     0|0   188b    
1k     8 shardb  SEC   14:48:54
      osmngs01       0      1      0      0       0      
2                  397m    10m      
0                                         238b     1k    17         RTR  
14:48:54
osmngs02:27017       0      0      0

Thanks again


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Hernandez  
View profile  
 More options Mar 21 2012, 11:15 am
From: Scott Hernandez <scotthernan...@gmail.com>
Date: Wed, 21 Mar 2012 11:15:24 -0400
Local: Wed, Mar 21 2012 11:15 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS
Can you please post the output from these command connected to a mongos:

use config
db.shards.find()
db.printShardingStatus()


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 21 2012, 11:29 am
From: "Simon T." <simon.tou...@gmail.com>
Date: Wed, 21 Mar 2012 08:29:12 -0700 (PDT)
Local: Wed, Mar 21 2012 11:29 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

 MongoDB shell version: 2.0.3
connecting to: localhost/admin
mongos> use config
switched to db config
mongos> db.shards.find()
{ "_id" : "sharda", "host" :
"sharda/osmnga01:27018,osmnga02:27018,osmnga03:27018" }
{ "_id" : "shardb", "host" :
"shardb/osmngb01:27018,osmngb02:27018,osmngb03:27018" }
mongos> db.printShardingStatus()
--- Sharding Status ---
  sharding version: { "_id" : 1, "version" : 3 }
  shards:
        {  "_id" : "sharda",  "host" :
"sharda/osmnga01:27018,osmnga02:27018,osmnga03:27018" }
        {  "_id" : "shardb",  "host" :
"shardb/osmngb01:27018,osmngb02:27018,osmngb03:27018" }
  databases:
        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
        {  "_id" : "test_db",  "partitioned" : true,  "primary" : "sharda" }
        {  "_id" : "hor",  "partitioned" : true,  "primary" : "sharda" }
        {  "_id" : "load_test",  "partitioned" : true,  "primary" :
"sharda" }
                load_test.loadtest chunks:
                                sharda  717
                                shardb  717
                        too many chunks to print, use verbose if you want
to force print
        {  "_id" : "lt2",  "partitioned" : true,  "primary" : "shardb" }
                lt2.loadtest chunks:
                                sharda  11
                                shardb  12
                        too many chunks to print, use verbose if you want
to force print
        {  "_id" : "hor-backup1",  "partitioned" : true,  "primary" :
"sharda" }
                hor-backup1.metrics chunks:
                                shardb  1
                                sharda  2
                        { "s_UID" : { $minKey : 1 } } -->> { "s_UID" :
"5380ef37bf19b550" } on : shardb { "t" : 2000, "i" : 0 }
                        { "s_UID" : "5380ef37bf19b550" } -->> { "s_UID" :
"e0e9eba1c3d2fc8d" } on : sharda { "t" : 2000, "i" : 1 }
                        { "s_UID" : "e0e9eba1c3d2fc8d" } -->> { "s_UID" : {
$maxKey : 1 } } on : sharda { "t" : 1000, "i" : 3 }
        {  "_id" : "localhost",  "partitioned" : false,  "primary" :
"shardb" }
        {  "_id" : "players",  "partitioned" : false,  "primary" : "shardb"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Studer  
View profile  
 More options Mar 22 2012, 12:14 pm
From: Greg Studer <g...@10gen.com>
Date: Thu, 22 Mar 2012 09:14:42 -0700 (PDT)
Local: Thurs, Mar 22 2012 12:14 pm
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hmm... still weird.  Can you up the logLevel of the mongos to 5 temporarily
- this will give us the exact options being used by the query as it is
dispatched.

mongo <mongos>

> use admin
> db.runCommand({ setParameter : 1, logLevel : 5 })
// Up
> db.runCommand({ setParameter : 1, logLevel : 0 })

Is/was the replica set setup with any hidden nodes?  rs.status()

If simple, can you replace the 2.0.3 mongos with a 2.0.2 mongos and see if
there's a change?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 23 2012, 10:43 am
From: "Simon T." <simon.tou...@gmail.com>
Date: Fri, 23 Mar 2012 07:43:43 -0700 (PDT)
Local: Fri, Mar 23 2012 10:43 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hi guys, here is the logs. I've enable it and launch a couple a query.

A line that caught my attention was:
Fri Mar 23 13:58:19 [conn380] dbclient_rs getSlave not selecting { addr:
"osmngb02:27018", isMaster: false, secondary: true, hidden: false, ok:
false }, not currently okForSecondaryQueries

Attached is a sample of the log file.

Tell me what do you think.

Simon

  mongodblog2.log
1216K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Mar 26 2012, 11:29 am
From: Kristina Chodorow <krist...@10gen.com>
Date: Mon, 26 Mar 2012 08:29:36 -0700 (PDT)
Local: Mon, Mar 26 2012 11:29 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Thanks for the log!  It looks like it's getting back healthy responses from
the secondaries but not updating that they are healthy.  I'm not sure why
it's not refreshing the secondaries' health, I've created a bug for it you
can track: https://jira.mongodb.org/browse/SERVER-5405.

In the meantime, have you tried restarting the mongos?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 26 2012, 1:04 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Mon, 26 Mar 2012 10:04:58 -0700 (PDT)
Local: Mon, Mar 26 2012 1:04 pm
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hi Kristina,

Our MongoDB administrator is out-of-office for the next 2 days (he's
currently at your MongoDB training for administrators in London ;) ).

We'll restart the mongos once he's back.

In the meantime, I'll watch the Jira issue.

Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tomáš Jelínek  
View profile  
 More options Mar 27 2012, 8:33 am
From: Tomáš Jelínek <jelinek....@gmail.com>
Date: Tue, 27 Mar 2012 05:33:54 -0700 (PDT)
Local: Tues, Mar 27 2012 8:33 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hi Kristina,

Yes, I can confirm MongoS servers were restarted but it doesn’t make any
difference.

I've quickly created a test php code to simulate this problem and I see
exactly same behaviour as Simon (he's testing java and c# drivers I
believe).

Also if I run queries directly from MongoS shell I still see only primary
nodes of each shard responding.

As Simon mentioned I am currently attuning MongoDB training in London so I
had a chance to show our mongo environment to Chris Harris - he had quick
look and according to him servers are healthy and overall setup is OK...

Regards

Tom

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 27 2012, 9:42 am
From: "Simon T." <simon.tou...@gmail.com>
Date: Tue, 27 Mar 2012 06:42:10 -0700 (PDT)
Local: Tues, Mar 27 2012 9:42 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

I confirm that I've tested it with Java, C# and python drivers.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Mar 27 2012, 10:07 am
From: Kristina Chodorow <krist...@10gen.com>
Date: Tue, 27 Mar 2012 07:07:40 -0700 (PDT)
Local: Tues, Mar 27 2012 10:07 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Yes, it looks like a bug in mongos, so it won't matter what language you
use.  If you connect directly to a replica set primary and run rs.status(),
what is the output?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tomáš Jelínek  
View profile  
 More options Mar 27 2012, 10:37 am
From: Tomáš Jelínek <jelinek....@gmail.com>
Date: Tue, 27 Mar 2012 07:37:54 -0700 (PDT)
Local: Tues, Mar 27 2012 10:37 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

*Shard A*

connecting to: localhost:27018/admin
PRIMARY> rs.status()
{
        "set" : "sharda",
        "date" : ISODate("2012-03-27T14:35:29Z"),
        "myState" : 1,
        "members" : [
                {
                        "_id" : 0,
                        "name" : "osmnga01:27018",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "optime" : {
                                "t" : 1332858904000,
                                "i" : 5
                        },
                        "optimeDate" : ISODate("2012-03-27T14:35:04Z"),
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "osmnga02:27018",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 403892,
                        "optime" : {
                                "t" : 1332858904000,
                                "i" : 5
                        },
                        "optimeDate" : ISODate("2012-03-27T14:35:04Z"),
                        "lastHeartbeat" : ISODate("2012-03-27T14:35:28Z"),
                        "pingMs" : 0
                },
                {
                        "_id" : 2,
                        "name" : "osmnga03:27018",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 210,
                        "optime" : {
                                "t" : 1332857863000,
                                "i" : 1
                        },
                        "optimeDate" : ISODate("2012-03-27T14:17:43Z"),
                        "lastHeartbeat" : ISODate("2012-03-27T14:35:29Z"),
                        "pingMs" : 23
                }
        ],
        "ok" : 1

}

PRIMARY>
*ShardB*

PRIMARY> rs.status()
{
        "set" : "shardb",
        "date" : ISODate("2012-03-27T14:36:48Z"),
        "myState" : 1,
        "syncingTo" : "osmngb02:27018",
        "members" : [
                {
                        "_id" : 0,
                        "name" : "osmngb01:27018",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                        "optime" : {
                                "t" : 1332853220000,
                                "i" : 1
                        },
                        "optimeDate" : ISODate("2012-03-27T13:00:20Z"),
                        "self" : true
                },
                {
                        "_id" : 1,
                        "name" : "osmngb02:27018",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 86910,
                        "optime" : {
                                "t" : 1332853220000,
                                "i" : 1
                        },
                        "optimeDate" : ISODate("2012-03-27T13:00:20Z"),
                        "lastHeartbeat" : ISODate("2012-03-27T14:36:46Z"),
                        "pingMs" : 0
                },
                {
                        "_id" : 2,
                        "name" : "osmngb03:27018",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                        "uptime" : 86910,
                        "optime" : {
                                "t" : 1332853220000,
                                "i" : 1
                        },
                        "optimeDate" : ISODate("2012-03-27T13:00:20Z"),
                        "lastHeartbeat" : ISODate("2012-03-27T14:36:46Z"),
                        "pingMs" : 0
                }
        ],
        "ok" : 1

}

PRIMARY>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kristina Chodorow  
View profile  
 More options Mar 27 2012, 10:51 am
From: Kristina Chodorow <krist...@10gen.com>
Date: Tue, 27 Mar 2012 07:51:40 -0700 (PDT)
Local: Tues, Mar 27 2012 10:51 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Okay, looks fine on that end.  I'd recommend following the ticket.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Randolph Tan  
View profile  
 More options Mar 29 2012, 1:52 pm
From: Randolph Tan <rando...@10gen.com>
Date: Thu, 29 Mar 2012 10:52:47 -0700 (PDT)
Local: Thurs, Mar 29 2012 1:52 pm
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hi Tomáš & Simon,

Would it be possible to provide the test scripts you were using? Is this
problem persistent, meaning does it not resolve after some time? I am
asking this because there is a background thread that tries to refresh the
state of all replica set connections every 10 seconds.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Mar 29 2012, 3:27 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Thu, 29 Mar 2012 12:27:40 -0700 (PDT)
Local: Thurs, Mar 29 2012 3:27 pm
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

The problem is indeed persistent, I never could get the queries to be
redirected to the secondary while passing by the mongos.

The scripts are very simple: it is just looping queries. Here is two
examples that does the same thing, one in java and the other one in C#:

JAVA:
try {
Mongo _mongo = new Mongo("osmngs01", 27017);
_mongo.setReadPreference(ReadPreference.SECONDARY);
DB db = _mongo.getDB("AAAAA");
if (db.authenticate("XXXXXXX", "YYYYYYYY".toCharArray()) == false) {
String message = String.format("Initialization Error: Failed to
authenticate to %1$s.", "osmngs01");
System.out.println(message);

}

DBCollection coll = db.getCollection("players");
for(int i=0;i<10000;i++)
{
DBObject player = coll.findOne(new BasicDBObject("s_nintendoID",
Integer.toString(i)));

System.out.println("index: " + i + " players: " + player);

}
} catch (UnknownHostException ex) {

String message = String.format("Initialization Error: Host %1$s does not
exists. Message: %2$s",
"osmngs01", ex.getMessage());
System.out.println(message);
} catch (MongoException ex) {

String message = String.format("Initialization Error: Cannot connect to
host %1$s:%2$s. Message: %3$s",
"osmngs01", 27017, ex.getMessage());
System.out.println(message);

}

AND C#:

string connectionString = "mongodb://XXXXX:YYYYY@osmngs01/?slaveOk=true";
MongoServer mongoServer = MongoServer.Create(connectionString);
MongoDatabase mongoDB = mongoServer.GetDatabase(MONGO_DB);
MongoCollection<BsonDocument> documents = mongoDB.GetCollection("players");
Random rndNb = new Random();
for (int i = 0; i < 15000; i++)
{
int iPlayer = rndNb.Next(1, 400000);
try
{
var query = Query.EQ("s_nintendoID", iPlayer.ToString());

BsonDocument bsonPlayer = documents.FindOne(query);

}

catch (Exception exc)
{
System.Diagnostics.Debug.WriteLine(exc.Message);

}
}

Simon

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Randolph Tan  
View profile  
 More options Apr 4 2012, 4:40 pm
From: Randolph Tan <rando...@10gen.com>
Date: Wed, 4 Apr 2012 13:40:55 -0700 (PDT)
Local: Wed, Apr 4 2012 4:40 pm
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Are you still having this issue? I am struggling to reproduce this bug. Do
you have a verbose logs of the replicas that corresponds to the same time
frame with the verbose mongos log that is experiencing this issue?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tomáš Jelínek  
View profile  
 More options Apr 5 2012, 10:23 am
From: Tomáš Jelínek <jelinek....@gmail.com>
Date: Thu, 5 Apr 2012 07:23:19 -0700 (PDT)
Local: Thurs, Apr 5 2012 10:23 am
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hi Randolph,

first - let me confirm - yes, the issue is permanent - its been like this
since we have noticed it long time ago.

Saying that, the logs Simon posted on March 23 are exactly what you are
asking for - i.e, verbose logs from the time frame while we are
experiencing the issue.

BTW I would suggest to take this conversation offline until we find the
solution, possibly to an email thread as I am slightly uncomfortable
talking about our set-up on public forum ( this is production mongo we
having issue with). I will try to contact you through G+ with private
message.

Regards
Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon T.  
View profile  
 More options Apr 5 2012, 12:05 pm
From: "Simon T." <simon.tou...@gmail.com>
Date: Thu, 5 Apr 2012 09:05:11 -0700 (PDT)
Local: Thurs, Apr 5 2012 12:05 pm
Subject: Re: [mongodb-user] Re: SlaveOk queries doesn't seems to go through mongoS

Hi Randolph,

here is the full log (level:5) of a RS, mongos and mongostat

The procedure was:

   1. Start fresh log on a server
   2. db.runCommand({ setParameter : 1, logLevel : 5 })
   3. Start a load test with the scripts that you can find on this thread

Simon

  slaveOKtest20120405.rar
811K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 34   Newer >
« Back to Discussions « Newer topic     Older topic »