Analyzing the bundled kafka client tools, the admin protocol expects resource name set to <default> when dynamically changing cluster-wide properties. However, trying to change a cluster property such as background.threads referring to ConnfigResource.name == <default>yields the following error generated in librdkafka.
error: Expected an int32 broker_id for ConfigResource(type=BROKER, name=<default>)
I am not sure if this is a limitation of the librdkafka implementation in general or the way the go client interacts with the librdkafka api.
How to reproduce
var cfgEntry = kafka.ConfigEntry{Name: "background.threads", Value: "11", Operation: kafka.AlterOperationSet}
var resourceType, _ = kafka.ResourceTypeFromString("BROKER")
cfg[0] = cfgEntry
configResource := kafka.ConfigResource{Type: resourceType, Name: "<default>", Config: cfg}
configResources[0] = configResource
if result, e := c.AlterConfigs(ctx, configResources); e == nil {
log.Info(fmt.Sprintf("Successfully applied %v changes.", len(result)))
}
Checklist
Please provide the following information:
[x] confluent-kafka-go and librdkafka version (LibraryVersion()):
gopkg.in/confluentinc/confluent-kafka-go.v1 v1.1.0
[x] Apache Kafka broker version:
2.1.1
[x] Client configuration: ConfigMap{...}
through SASL, but generally no connection issue
[ x] Operating system:
client osx, kafka on docker
[ x] Provide client logs (with "debug": ".." as necessary)
%7|1573577490.061|ADMINFAIL|rdkafka#producer-1| [thrd:app]: Admin ALTERCONFIGS result error: Expected an int32 broker_id for ConfigResource(type=BROKER, name=<default>)
[x] Provide broker log excerpts
not reaching the broker
Good find, seems like we need to add support for default entity names. In the case of BROKER the default name is empty, which I believe the librdkafka API disallows at this point.
Description
Analyzing the bundled kafka client tools, the admin protocol expects resource name set to
<default>
when dynamically changing cluster-wide properties. However, trying to change a cluster property such asbackground.threads
referring to ConnfigResource.name ==<default>
yields the following error generated in librdkafka.I am not sure if this is a limitation of the librdkafka implementation in general or the way the go client interacts with the librdkafka api.
How to reproduce
Checklist
Please provide the following information:
[x] confluent-kafka-go and librdkafka version (
LibraryVersion()
): gopkg.in/confluentinc/confluent-kafka-go.v1 v1.1.0[x] Apache Kafka broker version: 2.1.1
[x] Client configuration:
ConfigMap{...}
through SASL, but generally no connection issue[ x] Operating system: client osx, kafka on docker
[ x] Provide client logs (with
"debug": ".."
as necessary)[x] Provide broker log excerpts not reaching the broker
[ ] Critical issue