Skip to content

Commit

Permalink
[fix](inverted index) fix close error on inverted index writer (apach…
Browse files Browse the repository at this point in the history
…e#44601)

Related PR: apache#44205
fix close error on inverted index writer
  • Loading branch information
csun5285 authored Nov 26, 2024
1 parent aa15ca6 commit 4d48597
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,13 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter {
FINALLY_CLOSE(meta_out);
FINALLY_CLOSE(data_out);
FINALLY_CLOSE(index_out);
FINALLY_CLOSE(_dir);
FINALLY_CLOSE(_index_writer);
if constexpr (field_is_numeric_type(field_type)) {
FINALLY_CLOSE(_dir);
} else if constexpr (field_is_slice_type(field_type)) {
FINALLY_CLOSE(_index_writer);
// After closing the _index_writer, it needs to be reset to null to prevent issues of not closing it or closing it multiple times.
_index_writer.reset();
}
})

return Status::OK();
Expand Down

0 comments on commit 4d48597

Please sign in to comment.