From e76ba6bf1c02b8f43e128018ed492aeaea9c80f9 Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 15 Jul 2021 10:36:13 +0800 Subject: [PATCH] Fix NPE when broadcast dtl channel can't allocate buffer --- src/sql/dtl/ob_dtl_channel_agent.cpp | 2 +- src/sql/dtl/ob_dtl_flow_control.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/dtl/ob_dtl_channel_agent.cpp b/src/sql/dtl/ob_dtl_channel_agent.cpp index df8c5ab33d..36e970ee94 100644 --- a/src/sql/dtl/ob_dtl_channel_agent.cpp +++ b/src/sql/dtl/ob_dtl_channel_agent.cpp @@ -350,7 +350,7 @@ int ObDtlChanAgent::switch_buffer(int64_t need_size) if (OB_SUCC(ret)) { current_buffer_->set_bcast(); dtl_buf_encoder_.set_new_buffer(current_buffer_); - } else { + } else if (nullptr != current_buffer_) { dtl_buf_allocator_.free_buf(*bcast_ch, current_buffer_); } diff --git a/src/sql/dtl/ob_dtl_flow_control.cpp b/src/sql/dtl/ob_dtl_flow_control.cpp index 53f3f17adf..d5829d4b9d 100644 --- a/src/sql/dtl/ob_dtl_flow_control.cpp +++ b/src/sql/dtl/ob_dtl_flow_control.cpp @@ -59,7 +59,7 @@ int ObDtlFlowControl::init(uint64_t tenant_id, int64_t chan_cnt) } else { ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id)); if (tenant_config.is_valid() && true == tenant_config->_px_message_compression) { - compressor_type_ = ObCompressorType::STREAM_LZ4_COMPRESSOR; + compressor_type_ = ObCompressorType::LZ4_COMPRESSOR; } is_init_ = true; tenant_id_ = tenant_id; -- GitLab