| 586 | } |
| 587 | |
| 588 | Status BufferPool::Client::FinishMoveEvictedToPinned(Page* page) { |
| 589 | SCOPED_TIMER(counters().read_wait_time); |
| 590 | lock_guard<SpinLock> pl(page->buffer_lock); |
| 591 | // Another thread may have moved it to pinned in the meantime. |
| 592 | if (!page->pin_in_flight.Load()) return Status::OK(); |
| 593 | // Don't hold any locks while reading back the data. It is safe to modify the page's |
| 594 | // buffer handle without holding any locks because no concurrent operations can modify |
| 595 | // evicted pages. |
| 596 | RETURN_IF_ERROR(file_group_->WaitForAsyncRead( |
| 597 | page->write_handle.get(), page->buffer.mem_range(), &counters_)); |
| 598 | file_group_->DestroyWriteHandle(move(page->write_handle)); |
| 599 | page->pin_in_flight.Store(false); |
| 600 | return Status::OK(); |
| 601 | } |
| 602 | |
| 603 | Status BufferPool::Client::PrepareToAllocateBuffer( |
| 604 | int64_t len, bool reserved, bool* success) { |
no test coverage detected