Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7439

makeRecord() and makeDeletedRecord() do not use their size/len arguments

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.3.1
    • 2.2.0
    • Internal Code
    • None
    • Fully Compatible
    • ALL

    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().

      Attachments

        Activity

          People

            tad Tad Marshall
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: