IMD SolutionComputing LibraryShop main store

Troubleshooting

Why MQTT Transmission history is lost after a 50-second outage

Edge computing and IIoT Published 7 min read

Short answer

A 50-second outage on a 10-second write cycle should replay five buffered sets; a 100k store with a full day of retention cannot be the constraint. The sets are lost at the receiving gateway: Engine tag history, Store Historical Events, a mismatched primary host ID, or an invalid test that stops Transmission. Clear the store with arithmetic, then trace each handoff to MS SQL.

On this page
  1. Is the MQTT Transmission history store really the limit?
  2. Where does each historical event travel before it reaches the historian?
  3. Which settings on the receiving gateway reject replayed history?
  4. Why is disabling MQTT Transmission not a valid outage test?
  5. How do you run the outage test so the failing boundary shows?
  6. What do you fix, and in what order?
  7. Questions asked

A 50-second outage on a 10-second write cycle should replay five buffered data sets, and a 100k-event store with a full day of retention cannot be what drops them. When 3 of the 5 sets vanish, the events are being refused or misrouted downstream of MQTT Transmission: by MQTT Engine tag history settings, by Store Historical Events, by a primary host ID that differs between the two gateways, or the outage was simulated by stopping Transmission itself. The arithmetic clears the store first. The trace then follows each set from the Edge tags through Distributor and Engine into the historian and its MS SQL database, and closes with a fixed-configuration test that names the exact handoff where the sets disappear.

Is the MQTT Transmission history store really the limit? #

No. A store capped at 100k events with retention measured in hours cannot overflow on a handful of sets, and the arithmetic clears it before you change anything, which is exactly why resizing it and switching to disk storage changed nothing.

Run the numbers from the configuration. The PLC writes every tag every 10 seconds, so a 50-second disconnection holds 50 ÷ 10 = 5 sets. For HistoryMaxSize to bite, those five sets would need to total 100,000 events, or 20,000 per set, and no Manufacturing folder of BatchData, EdgeData and Results tags writes at that scale. Retention fails the same test: the module documents HistoryMaxAge in minutes, so the configured 1440 is 1440 × 60 = 86,400 seconds, a full day, and the outage adds under one minute of event age. The InMemory store lives in the Ignition gateway's Java heap, so it is fast and volatile; a gateway restart, not a 50-second outage, is what threatens it.

Here is the store as configured, with what each line governs:

Setting Configured value Role
StoreType InMemory Queued events held in the gateway's Java heap
HistoryMaxSize 100k Size cap of the store
HistoryMaxAge 1440 Maximum event age in minutes before events drop
FlushQuantity 1000 Events handled per flush operation
FlushPeriod 200 Cadence of flush operations
RollingBuffer Enabled Rolling retention and pruning on top of the store
RollingHistoryPruneInterval 60 How often pruning runs
RollingHistoryMaxAge 5400 Age limit for the rolling history
RollingHistoryPruneQuantity 1000 Events removed per pruning pass

With EnableHistoryStorageByDefault and In-OrderHistory both checked on the transmitter and PrimaryHost set on the EdgeSet, capture and ordered replay at the sending side are configured. Nothing in this table explains the loss, so move downstream.

Where does each historical event travel before it reaches the historian? #

Each set crosses five handoffs: PLC to Edge tags, Edge tags into the Transmission history store, store to MQTT Distributor over the network, Distributor to MQTT Engine, and Engine tags into the historian that writes MS SQL, and the sets die at exactly one of them.

Work them in order:

  1. Acquisition, PLC to Edge tags. Confirm fresh values and timestamps arrive in the Manufacturing folder every write cycle.
  2. Capture, Edge tags to the history store. With storage enabled by default, the queue must grow while the receiver is gone; the buffering and replay behavior is covered in how MQTT store and forward backfills after a connection outage.
  3. Publication, store to MQTT Distributor. Confirm the broker address and listener port the Edge PC dials, the same endpoint built in a Distributor broker setup walkthrough.
  4. Consumption, Distributor to MQTT Engine. Engine must come back, resubscribe, and accept the replayed events.
  5. Storage, Engine tags to the historian. The history settings on the Engine tags decide whether a replayed event is recorded with its original timestamp.

The historian stores what the Engine tags accept, not what Transmission sent. That one fact moves the investigation to the Standard gateway as soon as the store is shown to fill and then drain.

Which settings on the receiving gateway reject replayed history? #

Four documented faults eat replayed sets: tag history not configured on the MQTT Engine tags, Store Historical Events left false on the Engine side, a primary host ID that differs between Transmission and Engine, and an outage test that stops Transmission instead of the network.

  • Engine tag history. Every tag in BatchData, EdgeData and Results exists a second time as an MQTT Engine tag on the Standard gateway, and historizing only the Edge tags leaves those copies bare. Enable tag history on the Engine tags against the site's history provider; the historian can record only what they accept.
  • Store Historical Events. With in-order flush on the transmitter, replay arrives chronologically, and this Engine-side flag hands the stored events to tag history. Left false, a replayed set updates the current value and nothing else: screens recover while the database keeps the gap. Running Transmission asynchronously with the flag off is the documented losing combination; with In-OrderHistory already checked here, the flag is the half still unverified.
  • Primary host ID. The EdgeSet's PrimaryHost value and the Engine-side primary host ID must match, because the store-and-forward path is coordinated through that identity; a Transmission buffering for a host that never validates is traced in why MQTT Transmission fails to validate the primary host online.

With the store cleared by arithmetic and in-order flush already checked, the loss sits in one of these three receiving-side settings, and the next test shows which.

Why is disabling MQTT Transmission not a valid outage test? #

Stopping the module shuts down the very component that captures and buffers events, so nothing queues and nothing replays; a valid test breaks the network path to the receiver while Transmission keeps running and storing.

Disabling the network card on the Standard PC, the method already used, is the correct simulation: the Edge gateway, the transmitter and its store stay up, the PLC writes keep arriving, and the queue grows. Keep that method and add two rules. Change no store setting between runs, because flipping RollingBuffer, disk storage and In-OrderHistory across attempts is what hid the failing boundary so far. And expect the replay to be larger than the gap once the path is fixed, for the reason explained in why a short MQTT outage resends 24 hours of history.

How do you run the outage test so the failing boundary shows? #

Run one fixed-configuration pass and count sets at every handoff: five sets should enter the store, leave it on reconnect, update the Engine tags, and land in MS SQL, and the first stage holding fewer names the fault.

  1. Record the newest Edge tag timestamps and confirm one clean write from PLC to database while everything is online.
  2. Note the Distributor address and port in use and confirm the Edge PC reaches that endpoint.
  3. Schedule the pass when nothing downstream depends on live Standard-gateway data, because graphs and reports freeze for the duration.
  4. Disable only the network card on the Standard PC and hold it down for the full 50 seconds, leaving the Edge gateway, Transmission and the store running.
  5. Watch the Transmission history store during the outage; the queue should grow by one set per 10-second cycle.
  6. Re-enable the card and observe the sequence in order: MQTT reconnect, store flush, Engine reception, queue drain.
  7. Count the sets at each stage and compare Engine event timestamps with the rows in MS SQL.

The first stage that comes up short is the fault:

Observation Where the sets died What you fix
The store never grows Capture History storage not enabled for the transmitted tags
The store grows and stays queued after reconnect Path or host identity Endpoint reachability, then the primary host ID on both sides
Engine values update, no history for the outage window Acceptance Tag history on the Engine tags; Store Historical Events
Rows present but out of timestamp order Replay mode Keep In-OrderHistory checked on the transmitter

What do you fix, and in what order? #

Work the receiving gateway in this order: enable tag history on the Engine tags, set Store Historical Events, match the primary host ID character for character on Transmission and Engine, then rerun the network-card outage before touching a single store setting.

  • Open the MQTT Engine tags under BatchData, EdgeData and Results and enable tag history against the site's history provider.
  • Set Store Historical Events on the Engine side so replayed events pass to the historian instead of updating current values only.
  • Compare the EdgeSet's PrimaryHost with the Engine-side primary host ID and correct any mismatch before the next run.
  • Leave EnableHistoryStorageByDefault and In-OrderHistory checked on the transmitter, and leave the store table exactly as configured.
  • Rerun the outage with the network-card method and confirm every set arrives in MS SQL with its original timestamp.

The store was never the constraint: at this duty cycle its caps sit orders of magnitude above the outage, and the missing sets were refused at the Engine tags or misrouted by host identity. Fix those three, keep the test method, and the replay arrives complete.

Questions asked

Does moving the store to disk or raising its size protect against this loss?

No. Disk storage changes only what survives a restart of the Edge gateway itself; it does nothing for events a receiving gateway refuses. Switching to disk during this diagnosis was never going to close the gap, because the queue was nowhere near its size or age cap. Disk earns its place in one scenario: the Edge gateway rebooting mid-outage, which drops an InMemory queue along with the Java heap.

Why do live tag values recover after reconnect while the history keeps its gaps?

MQTT Engine applies every arriving event to a tag's current value, but only events accepted as history are handed to the historian. When Store Historical Events is false on the Engine side, replayed sets update the live display and then evaporate, so screens look healthy within seconds while the database never sees the outage window. That symptom points at tag history configuration, not at the network.

Does MQTT QoS 1 make the Transmission history store unnecessary?

No. QoS levels govern delivery over a connection that exists; once the receiver is unreachable there is no session to redeliver on, and the publisher must hold events itself. The history store is that hold. QoS 1 on the broker link still helps Distributor deliver to Engine across a client reconnect, but it carries data across a session interruption, not through an outage.

Should FlushQuantity and FlushPeriod be tuned to speed up the replay?

Not for this fault. The flush settings control how fast the queue drains after reconnect, the batch size and the cadence, not whether the receiver accepts what arrives. A backlog of this size sits under a single flush batch at the configured quantity, so drain speed is not in question. Tune them only when a large backlog after a long outage delays live data, and never between test runs, because changing them mid-diagnosis hides which boundary dropped the sets.

Keep reading

  • How-to

    MQTT store and forward backfill after a connection outage

    Yes. Tag data collected on the edge during the outage fills the server gap after reconnection, but only when Store and Forward is enabled in MQTT Transmission on the edge and history is enabled on the receiving MQTT Engine tags. Matching historian database names on both systems does nothing.

    Edge computing and IIoT

  • Troubleshooting

    Why a short MQTT outage resends 24 hours of history

    A sub-minute MQTT outage should replay at most a couple of minutes of records. When roughly a day of already-published history comes back, broker retransmission is not the cause: the rolling history buffer's read position has re-selected stored records. Trace the publisher's first batch by source timestamp and keep downstream deduplication in place.

    Edge computing and IIoT

  • Troubleshooting

    Why buffered Sparkplug B data is rejected after reconnect

    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.

    Edge computing and IIoT

Why Ignition tag history records only every 10 seconds