Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ilyama.golain.io/llms.txt

Use this file to discover all available pages before exploring further.

Backpressure prevents unbounded growth of staged rows in the cloud and gives devices a signal to stop sending when the server cannot keep up.

Two pause mechanisms

MechanismTriggerDevice downlink?Device keeps publishing?
Schema review pauseAmbiguous/breaking schemaNoYes — server stages
Volume backpressureStaged rows exceed cappause_lineageNo — buffer locally
Materialization circuit breakerRepeated mirror write failurespause_lineageNo — buffer locally
Schema review and volume backpressure both set lineage paused in Postgres, but only volume/CB paths send MQTT downlink controls.

Volume thresholds (defaults)

Per lineage, configured in edge replication policy:
SettingDefault
max_pending_rows_per_lineage100,000 rows
max_pending_bytes_per_lineage1 GiB
resume_threshold_percent80%
When staged count or bytes exceed the max:
  1. Insert edge_pending_controls row (pause_lineage).
  2. Set lineage paused.
  3. Publish integration.edge_ingest_control.requested.v1 → broker delivers sync/ingest/control.
  4. Device ACKs, stops publishing that source_table, buffers durably.
When both metrics fall below 80% of caps, sweepBackpressureResume:
  1. Sets lineage active.
  2. Sends resume_lineage downlink with server_watermark.

Device protocol

On pause_lineage

1. ACK immediately on sync/ingest/ack
2. Stop publishing batches for source_table
3. Buffer new journal rows locally (state.db + durable queue)
4. Record server_watermark from control message

On resume_lineage

1. ACK immediately
2. Drain buffer in commit_seq order starting at server_watermark + 1
3. Resume normal 5s flush loop
If local buffer exceeded retention during pause, request bootstrap snapshot via secondary flow (when implemented) before resuming incremental sync. Downlink control

Lineage-scoped pause

Pause affects one SQLite table on one device. Other tables on the same device continue syncing. Example: device_state paused for backpressure; order_events still publishes.

Materialization circuit breaker

Separate from volume caps:
  • After 5 permanent materialization errors, lineage pauses and device receives pause_lineage.
  • Operator inspects materialization error on lineage detail.
  • Fix binding/DDL/TSDB issue.
  • Call POST .../lineages/{id}/reset-materialization to clear counter and optionally trigger resume_lineage.
platform-tui: lineage detail → x when materialization error section is present.
TUI x reset applies to materialization circuit breaker, not volume backpressure. For volume pause, wait for auto-resume sweep or reduce staged backlog operationally.

Monitoring

SignalWhere
Lineage paused + no open reviewLikely backpressure or CB
edge_pending_controls open rowsPending downlink / unacked control
Staged row count growingApproaching cap — approve schema or scale worker/TSDB
Device logs “pause_lineage”Device correctly buffering
platform-tui events watch
# Look for integration.edge_table_lineage.ingestion_paused

Operator responses

SituationAction
Pause during schema reviewNormal — approve schema
Pause + staged at cap + no reviewWait for auto-resume or investigate worker health
Device offline during pauseQoS 1 downlink buffered by broker (persistent session)
Buffer lost on device after long pausePlan bootstrap snapshot (secondary flow) when available