Currently HAProxyKafka sets the kafka message timestamp to the moment it sends the message, and sets the timestamp-type to create.
It would be better to have it let kafka set the timestamp and use the logAppend timestamp-type, to let consumers know that this timestamp is not the one reflected in the data.
Description
Details
- Other Assignee
- brouberol
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | Antoine_Quhen | T354694 [Maintenance] Safeguard VarnishKafka to HAProxy analytics transition | |||
| Resolved | JAllemandou | T387750 [HAProxy migration] Compile expected migration delta, switch over plan and communicate | |||
| Resolved | Fabfur | T351117 Move analytics log from Varnish to HAProxy | |||
| Resolved | Fabfur | T370668 New software: haproxykafka | |||
| Resolved | JAllemandou | T388397 Make webrequest_frontend being ingested using the in-data `dt` field | |||
| Resolved | Fabfur | T389521 Update HAProxyKafka kafka-timestamp type |
Event Timeline
We tried (many thanks to @brouberol ) to explicitly set the DLQ topic to LogAppend and seems to work (meaning that messages sent by haproxykafka to DLQ uses the "correct" timestamp type).
kafka topics --topic webrequest_errors --alter --config message.timestamp.type=LogAppendTime
Problem here is that producer overrides are ignored so the type must be set explicitly on the topic(s) using the above command. Even if this survives a Kafka cluster restart, we must remember this in case we have to do on other topics in the future.
I'd say to proceed to set the correct type to the webrequest_text and webrequest_upload topics too
Problem here is that producer overrides are ignored
Ish. When the producer set a timestamp type override to LogAppendTime and the topic-level (or cluster-default) configuration is set to CreateTime, then the producer override is ignored.
This is pretty confusing, so my recommendation is to stick to topic-level configuration override (message.timestamp.type), like you said @Fabfur !
~ ❯ kafkacfg query 'name=*message.timestamp.type*' -v 1.1 | jq . [ { "name": "log.message.timestamp.type", "override": null, "description": "Define whether the timestamp in the message is message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`", "scope": "broker", "type": "string", "default": "CreateTime", "valid_values": "[CreateTime, LogAppendTime]", "importance": "medium", "update_mode": "cluster-wide" }, { "name": "message.timestamp.type", "override": null, "description": "Define whether the timestamp in the message is message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`", "scope": "topic", "type": "string", "default": "CreateTime", "valid_values": null, "server_default_property": "log.message.timestamp.type", "importance": "medium" } ]
brouberol@kafka-jumbo1014:~$ kafka topics --topic webrequest_text --alter --config message.timestamp.type=LogAppendTime
kafka-topics --zookeeper conf1007.eqiad.wmnet,conf1008.eqiad.wmnet,conf1009.eqiad.wmnet/kafka/jumbo-eqiad --topic webrequest_text --alter --config message.timestamp.type=LogAppendTime
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "webrequest_text".Traffic on webrequest_text is stable. I'm going to apply the config change on webrequest_upload now.
brouberol@kafka-jumbo1014:~$ kafka topics --topic webrequest_upload --alter --config message.timestamp.type=LogAppendTime
kafka-topics --zookeeper conf1007.eqiad.wmnet,conf1008.eqiad.wmnet,conf1009.eqiad.wmnet/kafka/jumbo-eqiad --topic webrequest_upload --alter --config message.timestamp.type=LogAppendTime
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "webrequest_upload".I'd say that this is now done, will wait confirmation from @JAllemandou to check that on their side all is fine
Thanks again @brouberol for all the debugging and work!
Actually we need to change webrequest_frontend_text and webrequest_frontend_upload topics, as those are the ones HAProxy sends data to (the webrequest_X will soon be deprecated)
Sure, I can do that. Should I also remove the topic config override on the webrequest_errors, webrequest_text and webrequest_upload topics?
I agree with @JAllemandou and I'd leave the configuration as is for the VK topics too!
Edit: clarification
brouberol@kafka-jumbo1014:~$ kafka topics --topic webrequest_frontend_upload --alter --config message.timestamp.type=LogAppendTime
kafka-topics --zookeeper conf1007.eqiad.wmnet,conf1008.eqiad.wmnet,conf1009.eqiad.wmnet/kafka/jumbo-eqiad --topic webrequest_frontend_upload --alter --config message.timestamp.type=LogAppendTime
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "webrequest_frontend_upload".
brouberol@kafka-jumbo1014:~$ kafkacat -C -b $TOPICMAPPR_KAFKA_ADDR -t webrequest_frontend_upload -c 1 -o end -f '%s' -J | jq .tstype
"logappend"
brouberol@kafka-jumbo1014:~$ kafka topics --topic webrequest_frontend_text --alter --config message.timestamp.type=LogAppendTime
kafka-topics --zookeeper conf1007.eqiad.wmnet,conf1008.eqiad.wmnet,conf1009.eqiad.wmnet/kafka/jumbo-eqiad --topic webrequest_frontend_text --alter --config message.timestamp.type=LogAppendTime
WARNING: Altering topic configuration from this script has been deprecated and may be removed in future releases.
Going forward, please use kafka-configs.sh for this functionality
Updated config for topic "webrequest_frontend_text".
brouberol@kafka-jumbo1014:~$ kafkacat -C -b $TOPICMAPPR_KAFKA_ADDR -t webrequest_frontend_text -c 1 -o end -f '%s' -J | jq .tstype
"logappend"Can confirm that both topics now have messages with tstype: logappend
Thanks for all the work (again)!
I think this can be closed now and leave it as reference for this Kafka peculiarity, in case we need to work again on the messages timestamps, we can open another one