pipelinedb / pipeline_kafka

PipelineDB extension for Kafka support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use security.protocol=SASL_PLAINTEXT error

gb198871 opened this issue · comments

pipeline_kafka.consumer_config = 'security.protocol=SASL_PLAINTEXT,sasl.mechanisms=PLAIN,sasl.username=admin,sasl.password=admin-secret'

2018-04-24 14:21:04 CSTLOG: worker process: [kafka consumer] kafka_ssl_stream <- pipelinedbtest (PID 23462) exited with exit code 1
Segmentation fault (PID 23464)
version: PipelineDB at revision on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit
query: (null)
backtrace:
pipelinedb: bgworker: [kafka consumer] kafka_ssl_stream <- pipelinedbtest (debug_segfault+0x15)[0x60b1a5]
/lib64/libpthread.so.0(+0xf5e0)[0x7f7b8aacb5e0]
/usr/local/pipelinedb/lib/pipelinedb/pipeline_kafka.so(+0x2f870)[0x7f7b832e2870]
/usr/local/pipelinedb/lib/pipelinedb/pipeline_kafka.so(rd_kafka_brokers_add0+0xc0)[0x7f7b832ecc10]
/usr/local/pipelinedb/lib/pipelinedb/pipeline_kafka.so(kafka_consume_main+0x536)[0x7f7b832cfd36]
pipelinedb: bgworker: [kafka consumer] kafka_ssl_stream <- pipelinedbtest (StartBackgroundWorker+0x17d)[0x66140d]
pipelinedb: bgworker: [kafka consumer] kafka_ssl_stream <- pipelinedbtest [0x66d1e5]
pipelinedb: bgworker: [kafka consumer] kafka_ssl_stream <- pipelinedbtest [0x47409a]
pipelinedb: bgworker: [kafka consumer] kafka_ssl_stream <- pipelinedbtest (PostmasterMain+0xe92)[0x66ee92]
pipelinedb: bgworker: [kafka consumer] kafka_ssl_stream <- pipelinedbtest (main+0x3e0)[0x474960]

I think this is a bug.
pipeline_kafka.c file configure_consumer function change SplitIdentifierString to SplitDirectoriesString,Because SplitIdentifierString change config string to lower.

static void configure_consumer(rd_kafka_conf_t *conf, rd_kafka_topic_conf_t *topic_conf)
{
List *opts;
ListCell *lc;
Assert(consumer_config);

if (!SplitDirectoriesString(consumer_config, ',', &opts))
	elog(ERROR, "failed to parse pipeline_kafka.consumer_config");

foreach(lc, opts)
{
	List *pair;
	char *kv = (char *) lfirst(lc);
	char *k;
	char *v;

	printf("键值 %s \n", kv );
	if (!SplitDirectoriesString(kv, '=', &pair))
	{
		elog(WARNING, "malformed configuration key-value pair: %s, ignoring", kv);
		continue;
	}

	if (list_length(pair) != 2)
	{
		elog(WARNING, "malformed configuration key-value pair: %s, ignoring", kv);
		continue;
	}

	k = (char *) linitial(pair);
	v = (char *) lsecond(pair);

	printf("键%s   值 %s\n", k,v);
	if (strncmp(k, "topic.", strlen("topic.")) == 0)
		rd_kafka_topic_conf_set(topic_conf, k, v, NULL, 0);
	else
		rd_kafka_conf_set(conf, k, v, NULL, 0);
}

}

Recompiled is running success .....

./configure
make
make install