Skip to content

measurements from disk buffer not (fully) retransmitted after output outtake #16981

@mo-krauti

Description

@mo-krauti

Relevant telegraf.conf

[agent]
  buffer_strategy = "disk"
  buffer_directory = "/var/lib/telegraf_buffer"
  debug = true

[global_tags]
  device_id = "${DEVICE_ID}"

[[outputs.influxdb_v2]]
  urls = ["${INFLUX_URL}"]
  token = "${INFLUX_TOKEN}"
  organization = "${INFLUX_ORG}"
  bucket = "${INFLUX_BUCKET}"

[[inputs.internal]]

[[inputs.mem]]

[[inputs.cpu]]

[[inputs.mqtt_consumer]]
  qos = 1
  persistent_session = true
  client_id = "telegraf_v1"

  servers = ["tcp://127.0.0.1:1883"]

  ## Topics that will be subscribed to.
  topics = [
    "telegraf/#",
  ]
  client_trace = true

[[outputs.file]]
  files = ["stdout"]

Logs from Telegraf

I added this as a file at the end because it is quite long.

System info

Telegraf 1.34.3 (git: HEAD@983d399f) using prebuilt armhf tarball from releases on custom yocto distribution

Docker

No response

Steps to reproduce

mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=48'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=48'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=49'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=48'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=48'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=50'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=60'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=61'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=62'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=62'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=62'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=62'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=62'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=63'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=64'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=32'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=71'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=71'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=71'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=72'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=81'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=82'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=82'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=91'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=92'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=true val=93'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=100'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=101'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=101'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=101'
mosquitto_pub -q 1 -t telegraf -m 'test6,offline=false val=102'

While sending the measurements tagged with offline=true I stopped the influxdb server.

Expected behavior

All measurements tagged with offline=true should appear in the influxdb once it is online again.

Actual behavior

Querying the influxdb for measurement test6 results in the following csv. The csv is missing all offline measurements during the first outtake and only contains 2 out of 3 measurements (92 and 93) from the second outtake. The output log contains all measurements, so the problem is not mqtt related.

#group,false,false,true,true,false,false,true,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string,string,string
#default,_result,,,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,device_id,host,offline,topic
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:08:43.342977894Z,48,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:09:47.847668418Z,48,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:09:50.338869283Z,48,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:09:53.651545837Z,49,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:09:57.147737175Z,48,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:09:59.71653157Z,48,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:10:03.718248561Z,50,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:13:33.424866265Z,71,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:13:35.526183824Z,71,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:13:37.445971938Z,71,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T11:13:40.448201245Z,72,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:09:08.693442466Z,81,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:09:38.460754199Z,82,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:09:40.488887087Z,82,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:10:34.694086281Z,100,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:10:37.638232148Z,101,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:10:40.524923117Z,101,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:10:42.39952108Z,101,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,0,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:12:14.110774832Z,102,val,test6,test,daccu-coprocessor-cm4-waveshare,false,telegraf
,,1,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:10:12.387700059Z,92,val,test6,test,daccu-coprocessor-cm4-waveshare,true,telegraf
,,1,2025-05-09T09:40:12.98839605Z,2025-05-09T12:40:12.98839605Z,2025-05-09T12:10:15.45824032Z,93,val,test6,test,daccu-coprocessor-cm4-waveshare,true,telegraf

Additional info

telegraf.log

Metadata

Metadata

Assignees

Labels

bugunexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions