Skip to content

Commit

Permalink
[Others] Add config for librdkafka debug (#8783) (#9167)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueeyu committed Jul 25, 2022
1 parent a98a99a commit 6de3061
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 10 additions & 4 deletions be/src/common/config.h
Expand Up @@ -23,8 +23,7 @@

#include "configbase.h"

namespace starrocks {
namespace config {
namespace starrocks::config {
// The cluster id.
CONF_Int32(cluster_id, "-1");
// The port on which ImpalaInternalService is exported.
Expand Down Expand Up @@ -743,6 +742,13 @@ CONF_String(starmgr_addr, "");
CONF_Int32(starlet_port, "9070");
#endif

} // namespace config
CONF_mBool(dependency_librdkafka_debug_enable, "false");

} // namespace starrocks
// A comma-separated list of debug contexts to enable.
// Producer debug context: broker, topic, msg
// Consumer debug context: consumer, cgrp, topic, fetch
// Other debug context: generic, metadata, feature, queue, protocol, security, interceptor, plugin
// admin, eos, mock, assigner, conf
CONF_String(dependency_librdkafka_debug, "all");

} // namespace starrocks::config
3 changes: 3 additions & 0 deletions be/src/runtime/routine_load/data_consumer.cpp
Expand Up @@ -89,6 +89,9 @@ Status KafkaDataConsumer::init(StreamLoadContext* ctx) {
RETURN_IF_ERROR(set_conf("auto.offset.reset", "error"));
RETURN_IF_ERROR(set_conf("api.version.request", "true"));
RETURN_IF_ERROR(set_conf("api.version.fallback.ms", "0"));
if (config::dependency_librdkafka_debug_enable) {
RETURN_IF_ERROR(set_conf("debug", config::dependency_librdkafka_debug));
}

for (auto& item : ctx->kafka_info->properties) {
if (boost::algorithm::starts_with(item.second, "FILE:")) {
Expand Down

0 comments on commit 6de3061

Please sign in to comment.