[SERVER-7439] makeRecord() and makeDeletedRecord() do not use their size/len arguments Created: 21/Oct/12 Updated: 11/Jul/16 Resolved: 23/Oct/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 2.2.0 |
| Fix Version/s: | 2.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tad Marshall | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Participants: |
| Description |
|
The MongoDataFile::makeRecord(DiskLoc dl, int size) method in src/mongo/db/pdfile.h does not use the 'size' argument that it is passed. MongoDataFile::makeRecord() is identical to MongoDataFile::recordAt(DiskLoc dl) except for the additional, unused, 'size' parameter. The only caller of MongoDataFile::makeRecord() is DataFileMgr::makeDeletedRecord(const DiskLoc& dl, int len), also in pdfile.h. makeDeletedRecord() ignores its incoming 'len' argument and passes sizeof(DeletedRecord) as the 'size' parameter to makeRecord() where, as noted above, the parameter is ignored. MongoDataFile::makeRecord() should be removed. DataFileMgr::makeDeletedRecord() should give up its unused 'len' parameter and should call MongoDataFile::recordAt() instead of makeRecord(). |
| Comments |
| Comment by auto [ 23/Oct/12 ] |
|
Author: {u'date': u'2012-10-22T10:03:17-07:00', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}Message: Remove the unused 'len' parameter from DataFileMgr::makeDeletedRecord(), make |