Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mongodb/mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
dwight committed Aug 29, 2011
2 parents cfcc0d3 + cba958b commit b969ac4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
7 changes: 6 additions & 1 deletion db/ops/update.cpp
Expand Up @@ -1002,7 +1002,12 @@ namespace mongo {

{
// we need to re-find in case something changed

d = nsdetails( ns );
if ( ! d ) {
// dropped
return UpdateResult(0, 0, 0);
}
nsdt = &NamespaceDetailsTransient::get_w(ns);
IndexDetails& i = d->idx(idIdxNo);
BSONObj key = i.getKeyFromQuery( patternOrig );
loc = i.idxInterface().findSingle(i, i.head, key);
Expand Down
3 changes: 3 additions & 0 deletions db/record.cpp
Expand Up @@ -190,6 +190,9 @@ namespace mongo {
char * end = data + netLength();
for ( ; addr <= end ; addr += 2048 ) {
__record_touch_dummy += addr[0];

break; // TODO: remove this, pending SERVER-3711

if ( ! entireRecrd )
break;
}
Expand Down
32 changes: 21 additions & 11 deletions jstests/indexl.js
@@ -1,17 +1,27 @@
// Check nonoverlapping $in/$all with multikeys SERVER-2165

t = db.jstests_indexl;
t.drop();

t.save( {a:[1,2]} );
assert.eq( 1, t.count( {a:{$all:[1],$in:[2]}} ) );
assert.eq( 1, t.count( {a:{$all:[2],$in:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[2],$all:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[1],$all:[2]}} ) );
function test(t) {
t.save( {a:[1,2]} );
assert.eq( 1, t.count( {a:{$all:[1],$in:[2]}} ) );
assert.eq( 1, t.count( {a:{$all:[2],$in:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[2],$all:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[1],$all:[2]}} ) );
assert.eq( 1, t.count( {a:{$all:[1],$in:[2]}} ) );
t.save({a:[3,4]})
t.save({a:[2,3]})
t.save({a:[1,2,3,4]})
assert.eq( 2, t.count( {a:{$in:[2],$all:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[3],$all:[1,2]}} ) );
assert.eq( 1, t.count( {a:{$in:[1],$all:[3]}} ) );
assert.eq( 2, t.count( {a:{$in:[2,3],$all:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[4],$all:[2,3]}} ) );
assert.eq( 3, t.count( {a:{$in:[1,3],$all:[2]}} ) );
}

t.drop();
test(t);
t.drop();
t.ensureIndex( {a:1} );
assert.eq( 1, t.count( {a:{$all:[1],$in:[2]}} ) );
assert.eq( 1, t.count( {a:{$all:[2],$in:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[2],$all:[1]}} ) );
assert.eq( 1, t.count( {a:{$in:[1],$all:[2]}} ) );
assert.eq( 1, t.count( {a:{$all:[1],$in:[2]}} ) );
test(t);
8 changes: 7 additions & 1 deletion util/net/listen.cpp
Expand Up @@ -295,8 +295,14 @@ namespace mongo {
if ( x == 0 && inShutdown() ) {
return; // socket closed
}
if( !inShutdown() )
if( !inShutdown() ) {
log() << "Listener: accept() returns " << s << " " << errnoWithDescription(x) << endl;
if (x == EMFILE || x == ENFILE) {
// Connection still in listen queue but we can't accept it yet
error() << "Out of file descriptors. Waiting one second before trying to accept more connections." << warnings;
sleepsecs(1);
}
}
continue;
}
if (from.getType() != AF_UNIX)
Expand Down

0 comments on commit b969ac4

Please sign in to comment.