-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Optimize rowset usage #933
Optimize rowset usage #933
Conversation
kangpinghuang
commented
Apr 16, 2019
•
edited
Loading
edited
- optimize incremental rowsetshared ptr ref to aquire the rowset object
- add unused_rowset_thread to delete unused rowset
- add need_delete_flag to mark deleted rowset
- optimize AlphaRowsetReader's constructor
void set_need_delete_file(bool need_delete_file) { | ||
_need_delete_file = need_delete_file; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a check here. if it is set need deleted it could not be reverted.
be/src/olap/storage_engine.cpp
Outdated
auto it = _unused_rowsets.begin(); | ||
for (; it != _unused_rowsets.end();) { | ||
if (it->second->in_use()) { | ||
LOG(INFO) << "start to delete unused rowset."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log is non-sense when has no unused rowset.
} else if (it->second->need_delete_file()){ | ||
LOG(INFO) << "start to remove rowset:" << it->second->rowset_id() | ||
<< ", version:" << it->second->version().first << "-" << it->second->version().second; | ||
OLAPStatus status = it->second->remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if failed, you can not remove it from unused rowset.
virtual bool delete_flag() = 0; | ||
|
||
virtual bool check_path(const std::string& path) = 0; | ||
|
||
bool need_delete_file() { | ||
return _need_delete_file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if _need_delete_file = false and rowset shared_ptr use_count() == 1 will happen meanwhile?
* [Feature-WIP](inverted) add inverted index compaction implementation (apache#851) * [Feature-WIP](inverted) add inverted index compaction implementation * [Feature-WIP](inverted) set condition for rowid vec trans * [Fix](inverted) remove useless function * [Fix](inverted) seperate compound directory fs and cfs, for cloud mode and other situations Co-authored-by: airborne12 <airborne08@gmail.com>