diff --git a/build.sh b/build.sh index 13b899418..b228154b8 100755 --- a/build.sh +++ b/build.sh @@ -157,7 +157,7 @@ function build { local build_type_lower=$(echo "$1" | tr '[:upper:]' '[:lower:]') # 转换为小写 echo "Build type: $build_type_lower" # 输出构建类型 - do_build "$build_type_lower" -DCMAKE_BUILD_TYPE="$build_type_lower" # 调用 do_build + do_build $@ -DCMAKE_BUILD_TYPE="$build_type_lower" # 调用 do_build } 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..74a8ea497 100644 --- a/src/observer/storage/buffer/disk_buffer_pool.cpp +++ b/src/observer/storage/buffer/disk_buffer_pool.cpp @@ -115,6 +115,7 @@ Frame *BPFrameManager::get_internal(const FrameId &frame_id) (void)frames_.get(frame_id, frame); if (frame != nullptr) { frame->pin(); + LOG_DEBUG("got a frame. frame=%s", frame->to_string().c_str()); } return frame; } @@ -138,6 +139,7 @@ Frame *BPFrameManager::alloc(int buffer_pool_id, PageNum page_num) frame->set_page_num(page_num); frame->pin(); frames_.put(frame_id, frame); + LOG_DEBUG("allocate a new frame. frame=%s", frame->to_string().c_str()); } return frame; } @@ -372,6 +374,7 @@ RC DiskBufferPool::allocate_page(Frame **frame) hdr_frame_->set_lsn(lsn); + LOG_DEBUG("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,8 +404,8 @@ RC DiskBufferPool::allocate_page(Frame **frame) return rc; } - LOG_INFO("allocate new page. file=%s, pageNum=%d, pin=%d", - file_name_.c_str(), page_num, allocated_frame->pin_count()); + LOG_INFO("allocate new page by extending bufferpool. buffer_pool_id=%d, pageNum=%d, pin=%d", + id(), page_num, allocated_frame->pin_count()); file_header_->allocated_pages++; file_header_->page_count++; @@ -705,7 +708,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/index/.bplus_tree.h.swp b/src/observer/storage/index/.bplus_tree.h.swp new file mode 100644 index 000000000..8858137b2 Binary files /dev/null and b/src/observer/storage/index/.bplus_tree.h.swp differ diff --git a/src/observer/storage/index/bplus_tree_log.cpp b/src/observer/storage/index/bplus_tree_log.cpp index e2ee32ff3..2225a38e1 100644 --- a/src/observer/storage/index/bplus_tree_log.cpp +++ b/src/observer/storage/index/bplus_tree_log.cpp @@ -33,7 +33,7 @@ BplusTreeLogger::BplusTreeLogger(LogHandler &log_handler, int32_t buffer_pool_id : log_handler_(log_handler), buffer_pool_id_(buffer_pool_id) {} -BplusTreeLogger::~BplusTreeLogger() { commit(); } +BplusTreeLogger::~BplusTreeLogger() {} RC BplusTreeLogger::init_header_page(Frame *frame, const IndexFileHeader &header) {