Skip to content

Operate and troubleshoot Orleans Journaling

Orleans Journaling is an experimental alpha feature. A production evaluation should define owners and tested procedures for package upgrades, storage-format migration, rollback, backup, restore, compaction, and provider outages.

Journaling emits metrics through the Microsoft.Orleans meter. Use the metrics catalog for the full instrument list.

At minimum, dashboard and alert on:

  • Storage operation errors and latency by append, snapshot, replace, read, and delete.
  • Recovery failures and recovery duration.
  • Storage-operation queue duration, which shows time waiting behind earlier work for the same journal.
  • Compaction triggers by storage_requested, migration, and user_snapshot.
  • Write coalescing, gathered state count, and operation byte distributions.
  • Azure Blob, Azure Table, or Redis provider operation errors and latency.

Correlate these signals with grain identity, provider dependency health, deployment version, and storage throttling.

Journal replay cost grows with bytes and operations since the latest snapshot. Snapshot cost grows with the complete durable state of the grain.

Capacity tests should include:

  • The largest expected durable collection and persistent-state payload.
  • Hot grain identities with frequent writes.
  • Activation after a long append sequence.
  • Provider-requested compaction during peak traffic.
  • Storage throttling, transient failures, and optimistic-concurrency recovery.
  • Backup and restore followed by activation and another write.

Tune provider thresholds before replay time, storage growth, or backend transaction limits become operational risks. The Azure Table provider limits one append batch to 2 MiB. Redis requests compaction at 128 MiB by default. Azure Blob compacts before exhausting its append-block budget.

Treat the package version, public API, journal format, application payload schema, and durable-state names as one compatibility contract.

  1. Back up journal bytes and metadata.
  2. Validate old data against the candidate binaries in an isolated environment.
  3. Keep all silos which can activate a journaling grain on a tested compatible version set.
  4. Deploy readers for old and new payload schemas before writers emit only the new schema.
  5. Observe recovery and migration-compaction metrics.
  6. Retain old readers, codecs, and state definitions through the rollback window.

A provider key prefix, blob-name mapping, table partition mapping, journal format key, or durable-state name defines how the runtime finds and interprets existing data. Perform and verify the corresponding data migration before a new mapping serves traffic.

Provider metadata selects the published generation and journal format. Back up metadata and journal data consistently. Restore them as one unit and keep the same application ServiceId, grain identities, state names, format readers, and payload codecs.

Exercise restore procedures regularly:

  1. Restore to an isolated provider namespace.
  2. Start a compatible silo.
  3. Activate representative grains and verify recovered state.
  4. Execute and acknowledge a new write.
  5. Trigger or await compaction and verify a second activation.
SymptomRuntime outcomeOperator response
Activation fails with a journal format keyRecovery leaves storage unchangedDeploy the required format and command codecs, or restore metadata which names the actual stored format
Activation reports malformed or truncated journal dataRecovery stops before activation completesQuarantine writes, restore a consistent backup, and preserve the failed data for diagnosis
InconsistentStateException during a writeThe write faults and the manager recovers before later workFind stale or competing writers, confirm grain identity and cluster configuration, then retry the application command according to its idempotency contract
Snapshot replacement fails after its pending append succeedsThe write faults while the mutation remains durable in the append historyReconcile using the operation identifier and retry the command only through its idempotency protocol
Write latency rises with storage queue durationWrites for the journal are waiting behind earlier operationsInspect provider latency and throttling, hot-grain traffic, write frequency, and snapshot size
Recovery time and journal bytes growThe current append history is largeConfirm compaction thresholds are enabled and that snapshot replacements succeed
Format migration reports an unregistered stateA retired stream still requires its previous codecRe-register the state for migration or retain the previous write format until retirement and compaction remove it
Redis state is lost after a server failureRecovery reflects the Redis durability configurationConfigure and test Redis persistence and replication for the required recovery point

Storage and codec exceptions are surfaced to the grain call. Preserve them in logs and traces rather than converting them into successful application responses.