forked from oceanbase/miniob
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Durability trx #5
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### What problem were solved in this pull request? Issue Number: close oceanbase#335 Problem: the first set/unset bit was not found correctly. ### What is changed and how it works? now the first set/unset bit could be found correctly.
### What problem were solved in this pull request? Issue Number: close oceanbase#337 Problem: ### What is changed and how it works? add docs/src/design/miniob-mysql-protocol.md in the following documents to remake the mdbook to make the website in the docs/src/miniob-introduction.md correct. > docs/src/SUMMARY.md > docs/src/design/introduction.md ### Other information
correct the wrong address ### What problem were solved in this pull request? Issue Number: close oceanbase#337 Problem: ### What is changed and how it works? sorry that I use a wrong address in oceanbase#338
修正 lecture-6 两处错别字
去掉默认自动检测当前机器上CPU的个数来决定编译并发数量,改由自己决策。 ### What problem were solved in this pull request? Issue Number: oceanbase#303 Problem:收到多名同学反馈编译执行buidl.sh卡死。build.sh中会自动检测当前机器上CPU的个数来决定编译并发数量,但是很多同学的机器内存与CPU并不匹配,会导致编译卡死。 ### What is changed and how it works? > 将此处改成`MAKE_ARGS=()` > >https://github.com/oceanbase/miniob/blob/f42235649b7d3860aaecc08265bb801b12dd7ef3/build.sh#L12 * 去掉并发编译,使用者各取所需,在执行build.sh时直接使用 -jN 参数自行选择并行度。 ### Other information
### What problem were solved in this pull request? Issue Number: close oceanbase#147 Problem: Not support with github codespace. ### What is changed and how it works? add .devcontainer file base on oceanbase/miniob
hnwyllmm
pushed a commit
that referenced
this pull request
Oct 22, 2024
### What problem were solved in this pull request? **Problem:** When I attempted to join multiple tables, `libsanitizer` detected a memory leak. The error log is as follows: ``` ==23682==ERROR: LeakSanitizer: detected memory leaks Direct leak of 768 byte(s) in 12 object(s) allocated from: #0 0x75f738946a2a in operator new(unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete.cpp:95 #1 0x56870207d56f in RowTuple::set_schema(Table const*, std::vector<FieldMeta, std::allocator<FieldMeta> > const*) /home/pepefloyd/git/miniob/src/observer/sql/expr/tuple.h:184 #2 0x56870208f737 in TableScanPhysicalOperator::open(Trx*) /home/pepefloyd/git/miniob/src/observer/sql/operator/table_scan_physical_operator.cpp:25 #3 0x568702081888 in NestedLoopJoinPhysicalOperator::right_next() /home/pepefloyd/git/miniob/src/observer/sql/operator/join_physical_operator.cpp:113 #4 0x568702083b42 in PredicatePhysicalOperator::next() /home/pepefloyd/git/miniob/src/observer/sql/operator/predicate_physical_operator.cpp:41 #5 0x56870206f411 in HashGroupByPhysicalOperator::open(Trx*) /home/pepefloyd/git/miniob/src/observer/sql/operator/hash_group_by_physical_operator.cpp:44 #6 0x568702085740 in ProjectPhysicalOperator::open(Trx*) /home/pepefloyd/git/miniob/src/observer/sql/operator/project_physical_operator.cpp:34 #7 0x568702038e2c in PlainCommunicator::write_result_internal(SessionEvent*, bool&) /home/pepefloyd/git/miniob/src/observer/net/plain_communicator.cpp:193 #8 0x56870203a7cc in PlainCommunicator::write_result(SessionEvent*, bool&) /home/pepefloyd/git/miniob/src/observer/net/plain_communicator.cpp:162 #9 0x568701ee5e4b in SqlTaskHandler::handle_event(Communicator*) /home/pepefloyd/git/miniob/src/observer/net/sql_task_handler.cpp:45 #10 0x56870202f0d7 in Worker::operator()() /home/pepefloyd/git/miniob/src/observer/net/one_thread_per_connection_thread_handler.cpp:96 #11 0x75f7384f78b3 in execute_native_thread_routine /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104 SUMMARY: AddressSanitizer: 768 byte(s) leaked in 12 allocation(s). ``` ### What is changed and how it works? To fix the memory leak, I identified that in the function `Tuple::set_schema`: ```cpp void set_schema(const Table *table, const std::vector<FieldMeta> *fields) { table_ = table; // fix: During a join, the right table's open is called multiple times, // which invokes set_schema repeatedly. This causes Tuple to store // unnecessary fields and values, so it is necessary to clear the existing ones first. this->speces_.clear(); this->speces_.reserve(fields->size()); for (const FieldMeta &field : *fields) { speces_.push_back(new FieldExpr(table, &field)); } } ``` The call to `this->speces_.clear()` does not destruct the existing `FieldExpr*` objects. As a result, the memory was not released properly. The fix I applied is to manually delete the `FieldExpr*` before clearing the vector, as shown below: ```cpp for (FieldExpr *spec : speces_) { delete spec; } ``` This ensures that memory allocated for `FieldExpr` is properly released, thus fixing the memory leak.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem were solved in this pull request?
事务模块的持久化