diff --git a/deps/common/log/log.h b/deps/common/log/log.h index f51b798c8..c31983bf7 100644 --- a/deps/common/log/log.h +++ b/deps/common/log/log.h @@ -319,6 +319,7 @@ int Log::out(const LOG_LEVEL console_level, const LOG_LEVEL log_level, T &msg) do { \ if (!(expression)) { \ LOG_PANIC(description, ##__VA_ARGS__); \ + LOG_PANIC("%s", lbt()); \ assert(expression); \ } \ } while (0) diff --git a/src/observer/storage/buffer/disk_buffer_pool.cpp b/src/observer/storage/buffer/disk_buffer_pool.cpp index 92215cc7f..7ceba56ac 100644 --- a/src/observer/storage/buffer/disk_buffer_pool.cpp +++ b/src/observer/storage/buffer/disk_buffer_pool.cpp @@ -372,6 +372,7 @@ RC DiskBufferPool::allocate_page(Frame **frame) hdr_frame_->set_lsn(lsn); + LOG_INFO("allocate a new page without extend buffer pool. page num=%d, buffer pool=%d", i, id()); lock_.unlock(); return get_this_page(i, frame); } @@ -401,7 +402,7 @@ RC DiskBufferPool::allocate_page(Frame **frame) return rc; } - LOG_INFO("allocate new page. file=%s, pageNum=%d, pin=%d", + LOG_INFO("allocate new page by extending bufferpool. file=%s, pageNum=%d, pin=%d", file_name_.c_str(), page_num, allocated_frame->pin_count()); file_header_->allocated_pages++; @@ -705,7 +706,7 @@ RC DiskBufferPool::allocate_frame(PageNum page_num, Frame **buffer) Frame *frame = frame_manager_.alloc(id(), page_num); if (frame != nullptr) { *buffer = frame; - LOG_DEBUG("allocate frame %p, page num %d", frame, page_num); + LOG_DEBUG("allocate frame %p, page num %d, frame=%s", frame, page_num, frame->to_string().c_str()); return RC::SUCCESS; } diff --git a/src/observer/storage/buffer/frame.cpp b/src/observer/storage/buffer/frame.cpp index b25ec67cc..c61972e3a 100644 --- a/src/observer/storage/buffer/frame.cpp +++ b/src/observer/storage/buffer/frame.cpp @@ -262,6 +262,6 @@ string Frame::to_string() const { stringstream ss; ss << "frame id:" << frame_id().to_string() << ", dirty=" << dirty() << ", pin=" << pin_count() - << ", lsn=" << lsn(); + << ", lsn=" << lsn() << ", this=" << this; return ss.str(); }