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.

Size and rate limits

LimitValue
Max MQTT batch payload512 KiB uncompressed JSON
Max rows per batch4,096
Flush interval5 seconds or 512 KiB, whichever first
Max snapshot / spill object1 GiB (zstd JSONL)
Presigned URL TTL15 minutes
Default staged backlog cap100,000 rows / 1 GiB per lineage
Resume threshold80% of backlog caps
Exceeding MQTT size → split batches or use secondary spill flow (when implemented).

Deduplication

Telemetry batches

KeyBehavior
(device_id, batch_id)Idempotent retry — same batch_id safe
batch_seqMust increase monotonically per (device_id, source_table)
ScenarioResult
Same batch_id + batch_seq already acceptedACK success (no-op)
New batch_id, duplicate batch_seqduplicate_batch_seq — drop batch
New batch_id, lower batch_seqstale_batch_seq — drop batch
Persist batch_seq across restarts unless journal reinitialized (then new journal_epoch for rows).

Row batches

Per-row dedup (not per-batch):
(device_id, source_table, journal_epoch, source_pk_hash, commit_seq)
Retry entire batch safe — already-seen rows skipped. journal_epoch must change when journal truncated/rebuilt.

Rejection codes (batch level)

CodeMeaningClient action
envelope_unstripped_tenant_fieldsTenant IDs in payloadRemove fields; fix client
invalid_format_versionMissing/zero format_versionFix payload
unsupported_format_versionFuture versionUpgrade/downgrade agent
invalid_batch_idNot UUIDv7Generate valid batch_id
batch_too_many_rows> 4096 rowsSplit batch
row_count_mismatchTelemetry count wrongFix row_count
cursor_timestamp_mismatchTelemetry cursors wrongFix cursor fields
invalid_row_idBad optional row_idFix or omit row_id
invalid_number_encodingNaN/Inf in JSON numbersSanitize floats
duplicate_batch_seqTelemetry seq clashDrop batch; advance
stale_batch_seqTelemetry seq regressionDrop batch
Full list: core/constants/edge_replication.go in ilyama.

Error handling summary

EventClient action
Batch rejected (format/validation)Fix payload — do not retry identical bytes
Batch rejected (seq duplicate/stale)Drop batch; advance cursor
pause_lineageACK → buffer → stop publish
resume_lineageACK → drain buffer in order
url_grantACK → PUT object → finalize
MQTT QoS 1 redeliveryRetry same batch_id
Presigned URL expiredNew url_request

Persistent client state

Must survive restarts:
StatePurpose
batch_seq (telemetry tables)Monotonic sequencing
commit_seq + journal_epoch (row tables)Cursor + dedup epoch
Unacked control IDsRe-ACK on broker redelivery
Backpressure bufferDrain after resume
server_watermark per paused tableResume start point
Schema hash per tableDrift detection
Omega stores in state.db — configure OMEGA_STATE_DB_PATH in production.

Hash formats

  • schema_hash: 64-char lowercase hex SHA-256
  • source_pk_hash: server-computed from canonical pk JSON