RecordFetcher* MmapV1ExtentManager::recordNeedsFetch( const DiskLoc& loc ) const { Record* record = _recordForV1( loc ); // For testing: if failpoint is enabled we randomly request fetches without // going to the RecordAccessTracker. if ( MONGO_FAIL_POINT( recordNeedsFetchFail ) ) { needsFetchFailCounter.increment(); if ( ( needsFetchFailCounter.get() % kNeedsFetchFailFreq ) == 0 ) { return new MmapV1RecordFetcher( record ); } } if ( !_recordAccessTracker->checkAccessedAndMark( record ) ) { return new MmapV1RecordFetcher( record ); } return NULL; }
std::unique_ptr<RecordFetcher> MmapV1ExtentManager::recordNeedsFetch(const DiskLoc& loc) const { if (loc.isNull()) return {}; MmapV1RecordHeader* record = _recordForV1( loc ); // For testing: if failpoint is enabled we randomly request fetches without // going to the RecordAccessTracker. if ( MONGO_FAIL_POINT( recordNeedsFetchFail ) ) { needsFetchFailCounter.increment(); if ( ( needsFetchFailCounter.get() % kNeedsFetchFailFreq ) == 0 ) { return stdx::make_unique<MmapV1RecordFetcher>( record ); } } if ( !_recordAccessTracker->checkAccessedAndMark( record ) ) { return stdx::make_unique<MmapV1RecordFetcher>( record ); } return {}; }
MmapV1RecordHeader* MmapV1ExtentManager::recordForV1( const DiskLoc& loc ) const { MmapV1RecordHeader* record = _recordForV1( loc ); _recordAccessTracker->markAccessed( record ); return record; }