Skip to content

Commit 49eaf0c

Browse files
authored
[fix](partial update) only report error when in strict mode partial update when finding missing rowsets during flushing memtable (#28764)
related pr: #28062, #28674, #28677 fix #28677
1 parent c1457f9 commit 49eaf0c

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

be/src/olap/rowset/beta_rowset_writer.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,6 @@ Status BetaRowsetWriter::_generate_delete_bitmap(int32_t segment_id) {
182182
{
183183
std::shared_lock meta_rlock(tablet->get_header_lock());
184184
specified_rowsets = tablet->get_rowset_by_ids(&_context.mow_context->rowset_ids);
185-
if (specified_rowsets.size() != _context.mow_context->rowset_ids.size()) {
186-
LOG(WARNING) << fmt::format(
187-
"[Memtable Flush] some rowsets have been deleted due to "
188-
"compaction(specified_rowsets.size()={}, but rowset_ids.size()={}), reset "
189-
"rowset_ids to the latest value. tablet_id: {}, cur max_version: {}, "
190-
"transaction_id: {}",
191-
specified_rowsets.size(), _context.mow_context->rowset_ids.size(),
192-
_context.tablet->tablet_id(), _context.mow_context->max_version,
193-
_context.mow_context->txn_id);
194-
return Status::InternalError<false>(
195-
"[Memtable Flush] some rowsets have been deleted due to compaction");
196-
}
197185
}
198186
OlapStopWatch watch;
199187
RETURN_IF_ERROR(tablet->calc_delete_bitmap(rowset, segments, specified_rowsets,

be/src/olap/rowset/segment_v2/segment_writer.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -412,16 +412,19 @@ Status SegmentWriter::append_block_with_partial_content(const vectorized::Block*
412412
{
413413
std::shared_lock rlock(tablet->get_header_lock());
414414
specified_rowsets = tablet->get_rowset_by_ids(&_mow_context->rowset_ids);
415-
if (specified_rowsets.size() != _mow_context->rowset_ids.size()) {
415+
if (_opts.rowset_ctx->partial_update_info->is_strict_mode &&
416+
specified_rowsets.size() != _mow_context->rowset_ids.size()) {
417+
// Only when this is a strict mode partial update that missing rowsets here will lead to problems.
418+
// In other case, the missing rowsets will be calculated in later phases(commit phase/publish phase)
416419
LOG(WARNING) << fmt::format(
417420
"[Memtable Flush] some rowsets have been deleted due to "
418-
"compaction(specified_rowsets.size()={}, but rowset_ids.size()={}), reset "
419-
"rowset_ids to the latest value. tablet_id: {}, cur max_version: {}, "
420-
"transaction_id: {}",
421-
specified_rowsets.size(), _mow_context->rowset_ids.size(), tablet->tablet_id(),
421+
"compaction(specified_rowsets.size()={}, but rowset_ids.size()={}) in strict "
422+
"mode partial update. tablet_id: {}, cur max_version: {}, transaction_id: {}",
423+
specified_rowsets.size(), _mow_context->rowset_ids.size(), _tablet->tablet_id(),
422424
_mow_context->max_version, _mow_context->txn_id);
423425
return Status::InternalError<false>(
424-
"[Memtable Flush] some rowsets have been deleted due to compaction");
426+
"[Memtable Flush] some rowsets have been deleted due to "
427+
"compaction in strict mode partial update");
425428
}
426429
}
427430
std::vector<std::unique_ptr<SegmentCacheHandle>> segment_caches(specified_rowsets.size());

be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,19 @@ Status VerticalSegmentWriter::_append_block_with_partial_content(RowsInBlock& da
346346
{
347347
std::shared_lock rlock(tablet->get_header_lock());
348348
specified_rowsets = tablet->get_rowset_by_ids(&_mow_context->rowset_ids);
349-
if (specified_rowsets.size() != _mow_context->rowset_ids.size()) {
349+
if (_opts.rowset_ctx->partial_update_info->is_strict_mode &&
350+
specified_rowsets.size() != _mow_context->rowset_ids.size()) {
351+
// Only when this is a strict mode partial update that missing rowsets here will lead to problems.
352+
// In other case, the missing rowsets will be calculated in later phases(commit phase/publish phase)
350353
LOG(WARNING) << fmt::format(
351354
"[Memtable Flush] some rowsets have been deleted due to "
352-
"compaction(specified_rowsets.size()={}, but rowset_ids.size()={}), reset "
353-
"rowset_ids to the latest value. tablet_id: {}, cur max_version: {}, "
354-
"transaction_id: {}",
355-
specified_rowsets.size(), _mow_context->rowset_ids.size(), tablet->tablet_id(),
355+
"compaction(specified_rowsets.size()={}, but rowset_ids.size()={}) in strict "
356+
"mode partial update. tablet_id: {}, cur max_version: {}, transaction_id: {}",
357+
specified_rowsets.size(), _mow_context->rowset_ids.size(), _tablet->tablet_id(),
356358
_mow_context->max_version, _mow_context->txn_id);
357359
return Status::InternalError<false>(
358-
"[Memtable Flush] some rowsets have been deleted due to compaction");
360+
"[Memtable Flush] some rowsets have been deleted due to "
361+
"compaction in strict mode partial update");
359362
}
360363
}
361364
std::vector<std::unique_ptr<SegmentCacheHandle>> segment_caches(specified_rowsets.size());

0 commit comments

Comments
 (0)