[KAFKA-273] Improve Logging and Diagnosability Regarding Heartbeat Messages Problems Created: 05/Jan/22  Updated: 25/Jul/22  Resolved: 21/Mar/22

Status: Closed
Project: Kafka Connector
Component/s: Source
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Diego Rodriguez (Inactive) Assignee: Robert Walters
Resolution: Won't Fix Votes: 0
Labels: internal-user, kafka-connect
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Case:

 Description   

Hi Team,

Currently, if heartbeat messages and SMT transformations are used together in a Source Connector configuration it can result in invalid heartbeat messages due to the SMT transformations modifying the heartbeat messages.

Special configuration has to be put in place to avoid the above. See an example below:

"predicates": "isHeartbeat"
"predicates.isHeartbeat.pattern": "__mongodb_heartbeats"
"predicates.isHeartbeat.type": "org.apache.kafka.connect.transforms.predicates.TopicNameMatches"
"transforms": "documentKeyToKey,flattenKey,extractId"
"transforms.extractId.field": "documentKey._id"
"transforms.extractId.type": "org.apache.kafka.connect.transforms.ExtractField$Key"
"transforms.extractId.predicate": "isHeartbeat"
"transforms.extractId.negate": true
"transforms.documentKeyToKey.type": "org.apache.kafka.connect.transforms.ValueToKey"
"transforms.documentKeyToKey.fields": "documentKey"
"transforms.documentKeyToKey.predicate": "isHeartbeat"
"transforms.documentKeyToKey.negate": true
"transforms.flattenKey.delimiter": ".",
"transforms.flattenKey.type": "org.apache.kafka.connect.transforms.Flatten$Key"
"transforms.flattenKey.predicate": "isHeartbeat"
"transforms.flattenKey.negate": true

Similarly, if heartbeat messages cannot be produced because of permission issues the Connector stays in RUNNING stage but without producing any messages. The only clue are permissions issues while trying to produce heartbeat messages:

[2022-01-03 19:15:55,002] INFO [connector|task-0] Generating heartbeat event. {"_data": "8261D34B68000000012B0229296E04"} (com.mongodb.kafka.connect.source.heartbeat.HeartbeatManager:77)
[2022-01-03 19:15:55,514] ERROR [connector|task-0] [Producer clientId=confluent.monitoring.interceptor.connector-connector] Connection to node -1 (****) failed authentication due to: Client SASL mechanism 'PLAIN' not enabled in the server, enabled mechanisms are [SCRAM-SHA-256] (org.apache.kafka.clients.NetworkClient:785)

It would be nice if we add a warning to the logs and/or prohibit a Connector without the needed properties and/or permissions to be launched. In the case of missing permissions to produce heartbeat messages, maybe the Connector should shift to the FAILED state with a clear message.

Regards
Diego



 Comments   
Comment by Robert Walters [ 21/Mar/22 ]

This is an issue within Kafka itself not the connector as there is no context within the Connector to determine or handle permissions within Kafka.

Generated at Thu Feb 08 09:05:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.