Skip to content

Rolling version skew

During a rolling deployment, silos can advertise different versions of the same grain interface. Orleans separates two questions: compatibility asks whether a requested version can be served by a candidate version, and selection chooses which compatible candidate to use. The grain version manifest, compatibility directors, selectors, and placement service answer those questions together.

Each silo contributes supported interface versions to GrainVersionManifest. The cached selector manager keys its result by grain type, interface, and requested version. It obtains available versions, filters them through the configured compatibility director, selects one or more versions, and maps those versions to suitable silos. The cache is invalidated when version or compatibility strategies change.

The built-in strategies have intentionally different upgrade behavior:

StrategyEffect
Strict compatibilityOnly the same interface version is eligible.
Backward compatibilityA newer implementation may serve an older request when the director says it is compatible.
All versions compatibleEvery advertised version is eligible.
Latest selectorChoose the highest compatible version.
Minimum selectorChoose the lowest compatible version.
All compatible selectorKeep all compatible versions as placement candidates.

The selector converts the compatibility decision into a placement set; applications preserve contract compatibility across that set.

Placement chooses a suitable silo, and an activation validates the incoming interface version against its local implementation. An incompatible activation invalidates the stale route and returns the existing message to routing. Version changes can therefore move activation or repeat routing while preserving the logical call.

Version routing requires request and response types readable by both old and new builds for as long as mixed traffic, queued messages, reminders, streams, or persisted state can cross the boundary. Keep serialization IDs stable, add fields with new IDs, retain aliases when CLR names move, and ensure custom codecs skip unknown fields. See serialization and code generation internals for the wire-level rules.

Grain-state compatibility remains an application schema responsibility. Both implementations read the stored representation and tolerate writes from the other while rollback or mixed placement remains possible.

  • An empty compatible-silo set causes placement to reject or time out the request.
  • A stale activation triggers cache invalidation and routing repair for the same logical message; the runtime preserves its message identity while locating a compatible activation.
  • Changing a selector or compatibility strategy resets the suitable-silo cache, so subsequent placements reflect the new policy.
  • Removing the old implementation before all callers and durable data are compatible can turn a planned rolling deployment into an outage.

The interface versioning guide and deployment and rollback guidance cover configuration and rollout procedures. This runtime decision chain connects interface manifests, compatibility selection, placement, activation validation, and wire compatibility.

Source: GrainVersionManifest, CachedVersionSelectorManager, AllCompatibleVersionsSelector, and ActivationData.