Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Jul 9, 2023
1 parent 26a97a3 commit 078588f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
13 changes: 5 additions & 8 deletions be/src/olap/full_compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <memory>
#include <mutex>
#include <ostream>
#include <shared_mutex>

#include "common/config.h"
#include "common/status.h"
Expand Down Expand Up @@ -106,14 +107,10 @@ Status FullCompaction::pick_rowsets_to_compact() {
}

Status FullCompaction::modify_rowsets(const Merger::Statistics* stats) {
// TODO: calculate publish rowsets delete bitmaps for full compaction.

std::lock_guard<std::mutex> wrlock_(_tablet->get_rowset_update_lock());
std::lock_guard<std::shared_mutex> wrlock(_tablet->get_header_lock());
RETURN_IF_ERROR(_tablet->full_compaction_update_delete_bitmap(
_output_rowset, pre_rowset_ids(),
std::make_shared<DeleteBitmap>(_output_rowset->rowset_meta()->tablet_id()),
_output_rs_writer.get()));
std::lock_guard<std::mutex> rowset_update_lock(_tablet->get_rowset_update_lock());
std::lock_guard<std::shared_mutex> header_lock(_tablet->get_header_lock());
RETURN_IF_ERROR(
_tablet->full_compaction_update_delete_bitmap(_output_rowset, _output_rs_writer.get()));
std::vector<RowsetSharedPtr> output_rowsets;
output_rowsets.push_back(_output_rowset);
RETURN_IF_ERROR(_tablet->modify_rowsets(output_rowsets, _input_rowsets, true));
Expand Down
6 changes: 1 addition & 5 deletions be/src/olap/tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,6 @@ Status Tablet::full_compaction_update_delete_bitmap(const RowsetSharedPtr& rowse
std::vector<segment_v2::SegmentSharedPtr> segments;
_load_rowset_segments(rowset, &segments);

std::shared_lock meta_rlock(_meta_lock);
// tablet is under alter process. The delete bitmap will be calculated after conversion.
if (tablet_state() == TABLET_NOTREADY &&
SchemaChangeHandler::tablet_in_converting(tablet_id())) {
Expand All @@ -3275,10 +3274,7 @@ Status Tablet::full_compaction_update_delete_bitmap(const RowsetSharedPtr& rowse
}

std::vector<RowsetSharedPtr> specified_rowsets;
{
std::shared_lock meta_rlock(_meta_lock);
specified_rowsets = get_rowset_by_ids(&rowset_ids_to_add);
}
specified_rowsets = get_rowset_by_ids(&rowset_ids_to_add);

OlapStopWatch watch;
RETURN_IF_ERROR(calc_delete_bitmap(rowset, segments, specified_rowsets, delete_bitmap,
Expand Down
2 changes: 0 additions & 2 deletions be/src/olap/tablet.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ class Tablet : public BaseTablet {
RowsetWriter* rowset_writer = nullptr);

Status full_compaction_update_delete_bitmap(const RowsetSharedPtr& rowset,
const RowsetIdUnorderedSet& pre_rowset_ids,
DeleteBitmapPtr delete_bitmap,
RowsetWriter* rowset_writer = nullptr);

Status update_delete_bitmap(const RowsetSharedPtr& rowset,
Expand Down

0 comments on commit 078588f

Please sign in to comment.