Block 3 — Failure Detection¶
Duration: 45 min
Simulate a Failure¶
- Confirm all devices are online first. Via Fleet Indexing, search for connected devices in your slot: the
connectivity.connected:truequery returns all of your devices - Stop one EC2 instance via the EC2 console → Instances (select a
workshop-ws-slot00-edge-*instance → Instance state → Stop instance) - Wait ~90 seconds — the device heartbeat goes stale (
device-healthshadowreported.last_heartbeatstops updating) and the UI marks the device asOFFLINE(heartbeat age > 60 s threshold) - Re-run the Fleet Indexing query to confirm the new state — search for disconnected devices in your slot: the
connectivity.connected:falsequery now returns the stopped device
Two Independent Signal Layers¶
| Signal | Source | What it detects |
|---|---|---|
| Shadow staleness | Application layer — device-health.reported.last_heartbeat |
Device process stopped, handler crashed, heartbeat timer failed |
| IoT Core connectivity | Transport layer — MQTT keep-alive timeout | Network unreachable, instance stopped, OS crash |
Using both gives you defence in depth: a device can be connected to IoT Core but have a crashed application (shadow staleness catches it), or disconnected entirely (connectivity status catches it).
Recovery¶
- Restart the instance via the EC2 console → Instances (select the stopped
workshop-ws-slot00-edge-*instance → Instance state → Start instance) - Observe the device reconnect using its existing permanent certificate — no re-provisioning occurs (the claim cert was deleted after first boot; the Device Client simply re-establishes the MQTT connection)
- Shadows re-populate automatically as the timer units resume
- The UI transitions back to
ONLINE
Wrap-Up¶
Recap the shadow model: desired/reported/delta pattern; named shadows for separation of concerns.
Preview Session 4: Cloud analytics — RisingWave materialized views, TimescaleDB continuous aggregates, and a side-by-side data freshness comparison across three storage tiers.