[SERVER-15033] Implement truncate() for non-capped MMAPv1 collections Created: 25/Aug/14  Updated: 29/Dec/14  Resolved: 08/Oct/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.7.5
Fix Version/s: 2.7.8

Type: Improvement Priority: Major - P3
Reporter: Kamran K. Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-15274 Implement remove({}) as Collection::t... Backlog
Tested
Backwards Compatibility: Fully Compatible
Participants:

 Description   

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);



 Comments   
Comment by Githook User [ 08/Oct/14 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-15033 Implement SimpleRecordStoreV1::truncate()
Branch: master
https://github.com/mongodb/mongo/commit/314c8b8f6b2d92c25175a2450ce02215d1f02d78

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