diff options
author | Dwight <dwight@10gen.com> | 2011-08-31 11:30:40 -0400 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2011-08-31 11:30:40 -0400 |
commit | c6a6cebea0c16ccf3bd919ba7e18c9b44678e620 (patch) | |
tree | 0a2890e2d30255e31f253869afc418fd10a86212 /db | |
parent | 1c5b750fdc624cbbade7e33ccc89c3e55faf5fc5 (diff) | |
parent | 8f2b751b77d1f948deb3f902b8213308004f1df1 (diff) | |
download | mongo-c6a6cebea0c16ccf3bd919ba7e18c9b44678e620.tar.gz |
Merge branch 'master' of github.com:mongodb/mongo
Diffstat (limited to 'db')
-rw-r--r-- | db/instance.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/db/instance.cpp b/db/instance.cpp index 971cd2e7b38..565b8cb39f9 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -604,7 +604,7 @@ namespace mongo { } if( !d.moreJSObjs() ) break; - js = d.nextJsObj(); + js = d.nextJsObj(); // TODO: refactor to do objcheck outside of writelock } } @@ -613,6 +613,12 @@ namespace mongo { const char *ns = d.getns(); op.debug().ns = ns; + if( !d.moreJSObjs() ) { + // strange. should we complain? + return; + } + BSONObj js = d.nextJsObj(); + writelock lk(ns); // writelock is used to synchronize stepdowns w/ writes @@ -623,11 +629,6 @@ namespace mongo { Client::Context ctx(ns); - if( !d.moreJSObjs() ) { - // strange. should we complain? - return; - } - BSONObj js = d.nextJsObj(); if( d.moreJSObjs() ) { insertMulti(d, ns, js); return; |