[fix](segcompaction) disable segcompaction when calculating delete bitmap (#23927)
Calc delete bitmap may generate segments, as a result, may trigger segcompaction. But the BetaRowsetWriter is a transient one and in Publishing context, which is bug-prone and hard to rollback. So let us disable the triggering in delete bitmap calc code path. Signed-off-by: freemandealer <freeman.zhang1992@gmail.com>
This commit is contained in:
@ -354,7 +354,8 @@ bool BetaRowsetWriter::_check_and_set_is_doing_segcompaction() {
|
||||
|
||||
Status BetaRowsetWriter::_segcompaction_if_necessary() {
|
||||
Status status = Status::OK();
|
||||
if (!config::enable_segcompaction || !_check_and_set_is_doing_segcompaction()) {
|
||||
if (!config::enable_segcompaction || !_context.enable_segcompaction ||
|
||||
!_check_and_set_is_doing_segcompaction()) {
|
||||
return status;
|
||||
}
|
||||
if (_segcompaction_status.load() != OK) {
|
||||
|
||||
@ -96,6 +96,9 @@ struct RowsetWriterContext {
|
||||
std::shared_ptr<MowContext> mow_context;
|
||||
std::shared_ptr<FileWriterCreator> file_writer_creator;
|
||||
std::shared_ptr<SegmentCollector> segment_collector;
|
||||
|
||||
// segcompaction for this RowsetWriter, disable it for some transient writers
|
||||
bool enable_segcompaction = true;
|
||||
};
|
||||
|
||||
} // namespace doris
|
||||
|
||||
@ -1983,6 +1983,7 @@ Status Tablet::create_transient_rowset_writer(RowsetSharedPtr rowset_ptr,
|
||||
context.tablet_schema->set_partial_update_info(false, std::set<std::string>());
|
||||
context.newest_write_timestamp = UnixSeconds();
|
||||
context.tablet_id = table_id();
|
||||
context.enable_segcompaction = false;
|
||||
// ATTN: context.tablet is a shared_ptr, can't simply set it's value to `this`. We should
|
||||
// get the shared_ptr from tablet_manager.
|
||||
context.tablet = StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id());
|
||||
|
||||
Reference in New Issue
Block a user