[SERVER-5243] mongos will route getLastError command to the config server when last insert triggered a split Created: 07/Mar/12  Updated: 11/Jul/16  Resolved: 18/May/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.3
Fix Version/s: 2.1.2

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-4874 unrecognized command: setShardVersion Closed
is duplicated by SERVER-3568 MongoException "norepl" is thrown whe... Closed
is duplicated by SERVER-8950 Getlasterror call return wrong result... Closed
Related
is related to SERVER-4267 getLastError "n" is 0 if previous wri... Closed
Operating System: ALL
Participants:

 Description   

Steps to reproduce:

1. Setup a sharded cluster (to make this easier to reproduce, set chunk size to 1).
2. Keep on doing inserts and call get last error with a w parameter for each insert.

Eventually (specifically, right when an auto-split occurred), the shards field for the getLastError result would contain the config server and will have a corresponding object that looks like:

{
	"n" : 0,
	"connectionId" : 8,
	"wnote" : "no replication has been enabled, so w=2+ won't work",
	"err" : "norepl",
	"ok" : 1
}

Some of drivers treat a non-null err field as an error and would throw an exception, which is bad.



 Comments   
Comment by auto [ 18/May/12 ]

Author:

{u'login': u'', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-5243 mongos will route getLastError command to the config server when last insert triggered a split

Added a guard to prevent callbacks for the ScopeDBConnection pool to add connections for getLastError.
Branch: master
https://github.com/mongodb/mongo/commit/228b2aa0ab7203686bdfaac874f18645a159ecd8

Generated at Thu Feb 08 03:08:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.