Original title: The emptycapped command fails to restore indexes for non-capped collections
In 2.7.0+, the emptycapped command fails to restore indexes for non-capped collections because truncate() is not implemented in SimpleRecordStoreV1. The command is also not replicated, which leads to inconsistent indexes across the primary and secondaries.
test_commands.cpp:
203 std::vector<BSONObj> indexes = stopIndexBuilds(txn, db, cmdObj); 204 205 Status status = collection->truncate(txn); 206 if ( !status.isOK() ) 207 return appendCommandStatus( result, status ); 208 209 IndexBuilder::restoreIndexes(indexes); 210 211 if (!fromRepl) 212 repl::logOp(txn, "c",(dbname + ".$cmd").c_str(), cmdObj);
- is depended on by
-
SERVER-15274 Implement remove({}) as Collection::truncate()
- Backlog