Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 bplus_tree_test 单测问题 #476

Merged
merged 8 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down
1 change: 1 addition & 0 deletions deps/common/log/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions src/observer/storage/buffer/disk_buffer_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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;
}

Expand Down
Binary file added src/observer/storage/index/.bplus_tree.h.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/observer/storage/index/bplus_tree_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Loading