Skip to content
Merged
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
5 changes: 3 additions & 2 deletions be/src/olap/delta_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ DeltaWriter::~DeltaWriter() {
if (!_delta_written_success) {
_garbage_collection();
}
for (SegmentGroup* segment_group : _segment_group_vec) {
segment_group->release();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_garbage_collection and this code will release a segment group twice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why _new_segment_group_vec doesn't need release?

SAFE_DELETE(_writer);
SAFE_DELETE(_mem_table);
SAFE_DELETE(_schema);
Expand All @@ -47,14 +50,12 @@ void DeltaWriter::_garbage_collection() {
OLAPEngine::get_instance()->delete_transaction(_req.partition_id, _req.transaction_id,
_req.tablet_id, _req.schema_hash);
for (SegmentGroup* segment_group : _segment_group_vec) {
segment_group->release();
OLAPEngine::get_instance()->add_unused_index(segment_group);
}
if (_new_table != nullptr) {
OLAPEngine::get_instance()->delete_transaction(_req.partition_id, _req.transaction_id,
_new_table->tablet_id(), _new_table->schema_hash());
for (SegmentGroup* segment_group : _new_segment_group_vec) {
segment_group->release();
OLAPEngine::get_instance()->add_unused_index(segment_group);
}
}
Expand Down