[SERVER-5151] sharded count can return a negative value if a negative limit is supplied Created: 29/Feb/12  Updated: 11/Jul/16  Resolved: 02/Aug/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 2.1.1

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

Issue Links:
Related
related to SERVER-5355 negative count limit brackets result ... Closed
related to SERVER-4555 check and clean sharding utilization ... Closed
Operating System: ALL
Participants:

 Description   

On mongod if a count is < 0 we bracket it up to 0. On mongos we just take the value of applySkipLimit, which can be < 0 if limit < 0.

                total = applySkipLimit( total , cmdObj );
                result.appendNumber( "n" , total );
                BSONObjBuilder temp( result.subobjStart( "shards" ) );
                for ( map<string,long long>::iterator i=shardCounts.begin(); i!=shardCounts.end(); ++i )
                    temp.appendNumber( i->first , i->second );
                temp.done();
                return true;



 Comments   
Comment by Aaron Staple [ 02/Aug/12 ]

See SERVER-5355 work.

Comment by Kevin Matulef [ 28/Jul/12 ]

I think this was fixed by patch for SERVER-5355. Aaron, can you confirm?

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