Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SERVER-485 fix validate on capped collection

  • Loading branch information...
commit 9f20ce7c030d50c40e912f150e71b708c70a9ac1 1 parent b88f54e
@dwight dwight authored
Showing with 8 additions and 1 deletion.
  1. +7 −0 db/dbcommands_admin.cpp
  2. +1 −1  jstests/capped1.js
View
7 db/dbcommands_admin.cpp
@@ -190,6 +190,13 @@ namespace mongo {
ndel++;
if ( loc.questionable() ) {
+ if( d->capped && !loc.isValid() && i == 1 ) {
+ /* [dm] the constructor for NamespaceDetails intentionally sets deletedList[1] to invalid -- presumably as
+ a defensive measure? (can't remember). So we allow it here.
+ */
+ break;
+ }
+
if ( loc.a() <= 0 || strstr(ns, "hudsonSmall") == 0 ) {
ss << " ?bad deleted loc: " << loc.toString() << " bucket:" << i << " k:" << k << endl;
valid = false;
View
2  jstests/capped1.js
@@ -4,7 +4,7 @@ t.drop();
db.createCollection("capped1" , {capped:true, size:1024 });
v = t.validate();
-//assert( v.valid , "A : " + tojson( v ) ); // SERVER-485
+assert( v.valid , "A : " + tojson( v ) ); // SERVER-485
t.save( { x : 1 } )
assert( t.validate().valid , "B" )
Please sign in to comment.
Something went wrong with that request. Please try again.