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
Message from discussion Writes block with custom getLastErrorModes

Received: by 10.58.222.100 with SMTP id ql4mr3786486vec.22.1348571879084;
        Tue, 25 Sep 2012 04:17:59 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.52.156.112 with SMTP id wd16ls5934vdb.6.gmail; Tue, 25 Sep
 2012 04:17:49 -0700 (PDT)
Received: by 10.52.173.228 with SMTP id bn4mr657540vdc.19.1348571869130;
        Tue, 25 Sep 2012 04:17:49 -0700 (PDT)
Date: Tue, 25 Sep 2012 04:17:48 -0700 (PDT)
From: Gianfranco <gianfra...@10gen.com>
To: mongodb-user@googlegroups.com
Message-Id: <a6383fb8-5f94-4237-9a1c-8947396aa997@googlegroups.com>
In-Reply-To: <ca00b038-4119-493a-8c4a-3b9acabc0dea@googlegroups.com>
References: <ca00b038-4119-493a-8c4a-3b9acabc0dea@googlegroups.com>
Subject: Re: Writes block with custom getLastErrorModes
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_178_10342265.1348571868850"

------=_Part_178_10342265.1348571868850
Content-Type: multipart/alternative; 
	boundary="----=_Part_179_10501205.1348571868851"

------=_Part_179_10501205.1348571868851
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The tagging seems correct.

What's the output of *rs.status() ? *is possible that there's a replication 
lag between members _id 2 and 0, and that's why the getLastError command 
timesout.

On Tuesday, September 25, 2012 11:23:57 AM UTC+1, Sebastian Friedel wrote:
>
> Hi, i'm trying to get a custom getLastErrorMode working, but currently 
> whenever I try to write using it, the getLastError Command blocks forever.
>
> I'm using the following ReplicaSet configuration.
>
> {
> "_id" : "test",
> "version" : 220224,
> "members" : [
> {
> "_id" : 2,
> "host" : "10.1.0.3:27017",
> "tags" : {
> "important" : "mongo-02"
> }
> },
> {
> "_id" : 4,
> "host" : "10.1.2.1:27017",
> "priority" : 0,
> "slaveDelay" : 14400,
> "hidden" : true
> },
> {
> "_id" : 0,
> "host" : "10.1.0.1:27017",
> "tags" : {
> "important" : "mongo-00"
> }
> }
> ],
> "settings" : {
> "getLastErrorModes" : {
> "twoimportant" : {
> "important" : 2
> }
> }
> }
> }
>
> I tried running the following test in the mongo cli:
>
> PRIMARY> db.test.insert({foo: 'bar'})
> PRIMARY> db.runCommand({getLastError: 1, w: 'twoimportant'})
>
> the last command blocks until i kill it.
>
> What I'm trying to accomplish is using the custom getLastErrorMode to 
> ensure my writes got written to a majority of the nodes that can become 
> PRIMARY while being flexible on the number of slaves I attach to the 
> ReplicaSet.
>
> Has anyone experienced this behaviour? Am I doing anything wrong here? 
> I've read over all avaliable documentation for tagging and 
> getLastErrorModes and as far as I could see this should work. Any help 
> would be appreciated.
>
> This was tested in ubuntu 12.04 with mongodb version 2.0.7.
>
> Regards
> Sebastian
>

------=_Part_179_10501205.1348571868851
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The tagging seems correct.<div><br></div><div>What's the output of <i>rs.st=
atus() ? </i>is possible that there's a replication lag between members _id=
 2 and 0, and that's why the getLastError command timesout.<br><br>On Tuesd=
ay, September 25, 2012 11:23:57 AM UTC+1, Sebastian Friedel wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
 1px #ccc solid;padding-left: 1ex;">Hi, i'm trying to get a custom getLastE=
rrorMode working, but currently whenever I try to write using it, the getLa=
stError Command blocks forever.<div><br></div><div>I'm using the following =
ReplicaSet configuration.</div><div><br></div><div><div>{</div><div><span s=
tyle=3D"white-space:pre">=09</span>"_id" : "test",</div><div><span style=3D=
"white-space:pre">=09</span>"version" : 220224,</div><div><span style=3D"wh=
ite-space:pre">=09</span>"members" : [</div><div><span style=3D"white-space=
:pre">=09=09</span>{</div><div><span style=3D"white-space:pre">=09=09=09</s=
pan>"_id" : 2,</div><div><span style=3D"white-space:pre">=09=09=09</span>"h=
ost" : "<a href=3D"http://10.1.0.3:27017" target=3D"_blank" class=3D"vt-p">=
10.1.0.3:27017</a>",</div><div><span style=3D"white-space:pre">=09=09=09</s=
pan>"tags" : {</div><div><span style=3D"white-space:pre">=09=09=09=09</span=
>"important" : "mongo-02"</div><div><span style=3D"white-space:pre">=09=09=
=09</span>}</div><div><span style=3D"white-space:pre">=09=09</span>},</div>=
<div><span style=3D"white-space:pre">=09=09</span>{</div><div><span style=
=3D"white-space:pre">=09=09=09</span>"_id" : 4,</div><div><span style=3D"wh=
ite-space:pre">=09=09=09</span>"host" : "<a href=3D"http://10.1.2.1:27017" =
target=3D"_blank" class=3D"vt-p">10.1.2.1:27017</a>",</div><div><span style=
=3D"white-space:pre">=09=09=09</span>"priority" : 0,</div><div><span style=
=3D"white-space:pre">=09=09=09</span>"slaveDelay" : 14400,</div><div><span =
style=3D"white-space:pre">=09=09=09</span>"hidden" : true</div><div><span s=
tyle=3D"white-space:pre">=09=09</span>},</div><div><span style=3D"white-spa=
ce:pre">=09=09</span>{</div><div><span style=3D"white-space:pre">=09=09=09<=
/span>"_id" : 0,</div><div><span style=3D"white-space:pre">=09=09=09</span>=
"host" : "<a href=3D"http://10.1.0.1:27017" target=3D"_blank" class=3D"vt-p=
">10.1.0.1:27017</a>",</div><div><span style=3D"white-space:pre">=09=09=09<=
/span>"tags" : {</div><div><span style=3D"white-space:pre">=09=09=09=09</sp=
an>"important" : "mongo-00"</div><div><span style=3D"white-space:pre">=09=
=09=09</span>}</div><div><span style=3D"white-space:pre">=09=09</span>}</di=
v><div><span style=3D"white-space:pre">=09</span>],</div><div><span style=
=3D"white-space:pre">=09</span>"settings" : {</div><div><span style=3D"whit=
e-space:pre">=09=09</span>"getLastErrorModes" : {</div><div><span style=3D"=
white-space:pre">=09=09=09</span>"twoimportant" : {</div><div><span style=
=3D"white-space:pre">=09=09=09=09</span>"important" : 2</div><div><span sty=
le=3D"white-space:pre">=09=09=09</span>}</div><div><span style=3D"white-spa=
ce:pre">=09=09</span>}</div><div><span style=3D"white-space:pre">=09</span>=
}</div><div>}</div></div><div><br></div><div>I tried running the following =
test in the mongo cli:</div><div><br></div><div><div>PRIMARY&gt; db.test.in=
sert({foo: 'bar'})</div><div>PRIMARY&gt; db.runCommand({getLastError: 1, w:=
 'twoimportant'})</div></div><div><br></div><div>the last command blocks un=
til i kill it.</div><div><br></div><div>What I'm trying to accomplish is us=
ing the custom getLastErrorMode to ensure my writes got written to a majori=
ty of the nodes that can become PRIMARY while being flexible on the number =
of slaves I attach to the ReplicaSet.</div><div><br></div><div>Has anyone e=
xperienced this behaviour? Am I doing anything wrong here? I've read over a=
ll avaliable documentation for tagging and getLastErrorModes and as far as =
I could see this should work. Any help would be appreciated.</div><div><br>=
</div><div>This was tested in ubuntu 12.04 with mongodb version 2.0.7.</div=
><div><br></div><div>Regards</div><div>Sebastian</div></blockquote></div>
------=_Part_179_10501205.1348571868851--

------=_Part_178_10342265.1348571868850--