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

Optimize rowset usage #933

Merged

Conversation

kangpinghuang
Copy link
Contributor

@kangpinghuang kangpinghuang commented Apr 16, 2019

  1. optimize incremental rowsetshared ptr ref to aquire the rowset object
  2. add unused_rowset_thread to delete unused rowset
  3. add need_delete_flag to mark deleted rowset
  4. optimize AlphaRowsetReader's constructor

void set_need_delete_file(bool need_delete_file) {
_need_delete_file = need_delete_file;
}

Copy link
Contributor

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.

auto it = _unused_rowsets.begin();
for (; it != _unused_rowsets.end();) {
if (it->second->in_use()) {
LOG(INFO) << "start to delete unused rowset.";
Copy link
Contributor

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();
Copy link
Contributor

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;
Copy link
Contributor

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?

@chaoyli chaoyli merged commit 294d9a6 into apache:be_refactor Apr 16, 2019
@kangpinghuang kangpinghuang deleted the be_refactor_new_optimize_rowset_ref branch August 20, 2019 06:54
liaoxin01 pushed a commit to liaoxin01/doris that referenced this pull request Nov 18, 2022
* [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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants