Troubleshooting
Why buffered Sparkplug B data is rejected after reconnect
Short answer
Replayed samples are dropped because the MQTT Publisher component in System Platform v2023 P01 sends them without the per-metric is_historical = true flag the Eclipse Sparkplug B specification defines for late data, so the broker treats old timestamps as suspect. No setting in that component sets the flag; keep MQTT for live values and recover the outage window through a separate backfill path.
On this page
Replayed store-and-forward samples are dropped because they leave the publisher without the per-metric is_historical = true flag that the Eclipse Sparkplug B specification defines for late, buffered data. The Cogent Datahub Sparkplug B broker enforces that rule: it does not process old-timestamped metrics that arrive unflagged, while live values continue normally after reconnect. The MQTT Publisher component installed with System Platform v2023 P01 does not set the flag, and no parameter in that component turns it on; the vendor lists support as under consideration. The decision: keep MQTT for live values, confirm the missing flag once in a decoded capture, and recover the outage window through a separate backfill path.
Split the fault before touching the payload #
If live values also stop updating in the broker after reconnect, this is not the replay problem — fix the session first: broker address, client ID, credentials, Sparkplug group and edge node IDs. The replay fault has a narrow signature: live metrics update at their normal rate, Wireshark shows the buffered PUBLISH packets leaving the host, and only the outage-window samples are missing from the broker. That combination points at payload content, not connectivity or tag binding.
What the specification requires #
Sparkplug B payloads are Google Protocol Buffers, and the specification gives each metric optional fields. One of them is is_historical, a Boolean that marks the metric as a historical value: data stored at the edge and now replayed. Sibling quality flags mark transient values, which a historian should not store, and null, which marks sensor failure. Together they let a consumer tell stored-and-forwarded data from current process state.
Protobuf omits a Boolean that is false or unset, so on the wire flag-false and flag-never-set look identical. A consumer that enforces the marker has no way to recognize your replay except the publisher setting it. Your replayed metrics arrive as ordinary live updates carrying old timestamps, and the broker does not process them.
Confirm the missing flag in a capture #
Do not infer the absence from the gap — decode it. Wireshark shows the MQTT payload as raw bytes until you give its Protobuf support the .proto file published with the specification, so load that first or export the payload to a Sparkplug-aware decoder.
- Capture on the publisher host or a mirror port, filtered to the broker MQTT port.
- Block the link, let the buffer fill while process values keep changing, then restore it.
- Move past the CONNECT and birth traffic to the first data PUBLISH packets; their topics carry the NDATA or DDATA message type.
- Decode each payload against the specification
.protofile and read the per-metricis_historicalfield.
A set flag has a shape you can derive from the encoding rule. is_historical is a varint field, field 5 in the Metric message — confirm the number against the .proto file you decode with. The tag byte is (5 × 8) + 0 = 40 decimal = 0x28, followed by 0x01 for true, so a set flag appears as the byte pair 28 01 inside the metric. Raw hex search is screening only: timestamps and float values throw false positives. The decoded result is the evidence: replayed metrics carry pre-outage timestamps and no is_historical field. That matches the documented publisher limitation, and no publisher-side setting changes it.
Where the fix would live, and why it is not there #
The parameter does not exist in this component version, so do not hunt through publisher or tag-mapping options for it. Write down two facts instead:
- The installed driver version — System Platform v2023 P01 here — read from the installer or version listing.
- The decoded capture showing the flag state after a replay.
The vendor position for this driver line is that the MQTT Publisher component does not support setting is_historical and that support is under consideration for a future version. Treat that as version-scoped: reread the release notes and rerun the decoded capture after any upgrade before you dismantle a workaround.
Choose the recovery path #
Pick one path; each keeps live data intact while the flag is unavailable at the source.
- Broker-side tolerance: a documented broker setting that accepts unflagged late data. Valid only if the Datahub documentation names it, and replayed values may overwrite current state with old ones until the replay finishes.
- An intermediary that rewrites the payload: a component between publisher and broker that re-flags replayed metrics. It must reliably tell replayed from live samples, and it is one more thing to maintain.
- A separate backfill path: MQTT carries live values only, and the outage window is recovered historian-side. Two data paths to reconcile, no dependence on the flag.
- Disable publisher store-and-forward: accept the gap. No rejected traffic, and nothing recovered.
The decision: run the separate backfill path while the flag stays unsupported. It works with the component you have and never risks a stale value overwriting live state. Reserve the intermediary for consumers that must receive the samples over Sparkplug B, and broker tolerance for installations whose documentation names the setting. The mechanics of closing the gap that way are covered in MQTT store and forward backfill after a connection outage, and how a consumer surfaces the recovered rows — Ignition does it through reference tags — in getting backfilled Sparkplug history through Ignition reference tags.
Prove it with a controlled outage #
Run this in a maintenance window or from a test host: blocking the broker port on a production publisher mid-run can starve a live consumer. Record the baseline first — metric names, update rate, broker tag quality with the link up — then change one element only and restart the publisher session so it issues fresh birth messages. Confirm the edge node shows online with all metrics before any outage test.
Block the broker port from 09:14:00 to 09:26:00. The outage is 12 min = 720 s, and at a 5 s publish period the buffer holds 720 ÷ 5 = 144 samples, timestamped 09:14:00 through 09:25:55, with values still changing throughout. Restore the link and capture the reconnect, then judge by path:
- Backfill path passes when the destination holds 144 rows spanning 09:14:00 to 09:25:55 with original timestamps, while the MQTT stream shows no processed replay — the backfill closes the gap, not the replay.
- Intermediary or broker-tolerance path passes when replayed metrics decode with
is_historical = true, the broker log records them accepted, and the broker current value equals the live process value once the replay finishes, proving no old sample overwrote state.
If the recovered rows fall short of 144, the shortfall never reached the buffer: samples lost before buffering are the separate loss mode covered in the QoS 0 loss window in Sparkplug MQTT transmission. Close the test by stating which path owns the outage window and which owns live values, with no overlap that duplicates samples.
Questions asked
Can the broker set is_historical on the data it receives?
No. The flag is a per-metric field inside the protobuf payload, so only the publisher can set it when the message is built. A broker can at most tolerate its absence; adding it after the fact means rewriting the payload, which is the intermediary option rather than a broker setting.
Does raising the MQTT QoS fix the rejection?
No. QoS governs whether each PUBLISH is delivered and acknowledged; is_historical governs how a consumer treats replayed content. Your replayed packets already arrive, since you can watch them leave in the capture, so a stronger delivery guarantee changes nothing about what the broker does with unflagged old timestamps.
Is is_transient the flag I need instead?
No. The specification per-metric quality flags answer different questions: is_historical marks a value that was stored and is now replayed, is_transient marks a value a historian should not store, and null marks sensor failure. A replayed sample needs is_historical; flagging it is_transient instead tells the consumer to discard it.
How do I size the outage window I have to recover?
Buffered samples equal outage seconds divided by publish period. A 12-minute block at a 5-second period gives 720 divided by 5, so 144 samples, and 144 rows with original timestamps is what to verify in the backfill destination. A shortfall means samples never reached the buffer, not that the broker rejected more of them.
Will a driver upgrade add the flag?
Not in System Platform v2023 P01, where no parameter exists; the vendor lists support as under consideration. After any upgrade, run the same test before removing a workaround: block the link, restore it, decode the first replayed PUBLISH packets, and confirm is_historical appears on each metric.