Skip to content

Fix durable Map/Parallel replay: MapIteration subtype + inline per-unit results#2476

Merged
GarrettBeatty merged 1 commit into
devfrom
durable-map-iteration-subtype-and-inline-results
Jul 14, 2026
Merged

Fix durable Map/Parallel replay: MapIteration subtype + inline per-unit results#2476
GarrettBeatty merged 1 commit into
devfrom
durable-map-iteration-subtype-and-inline-results

Conversation

@GarrettBeatty

Copy link
Copy Markdown
Contributor

Description

Fixes two durable-execution Map/Parallel conformance issues found by running the multi-language conformance suite against the .NET SDK and comparing with the JS/Python/Java reference SDKs.

1. Map iteration SubType: MapItemMapIteration

Per-item map iteration child contexts were checkpointed with SubType: "MapItem". The JS, Python, and Java SDKs all use "MapIteration":

  • JS: "SubType": "MapIteration"
  • Python: MAP_ITERATION = "MapIteration"
  • Java: MAP_ITERATION(OperationType.CONTEXT, "MapIteration")

Renamed OperationSubTypes.MapItemOperationSubTypes.MapIteration and its wire value.

2. Per-unit results lost on post-operation replay (Nested)

A Nested Parallel/Map persisted per-unit results only on the children's own CONTEXT checkpoints, not inline on the parent SUCCEED payload. But the service collapses completed per-unit child contexts out of the state returned on a later resume, so a batch that completes and then suspends (e.g. a wait after the map) reconstructed [null, ...] on replay because the child ops were no longer in state.

Fix: record each dispatched unit's result/error inline on the parent summary for both Nested and Flat nesting (mirroring the JS SDK's default BatchResult serdes, which serializes the whole all array into the parent payload). The reconstruct path prefers the inline copy and falls back to child checkpoints. The overflow-strip + ReplayChildren path now applies to both nesting modes, so large aggregate results still degrade gracefully.

Motivation and Context

Surfaced by cross-SDK conformance testing (map operation 9, 9-17 map-then-wait). Both were real cross-SDK divergences, not test defects.

Testing

  • Full Amazon.Lambda.DurableExecution.Tests unit suite: 412/412 pass.
  • Added unit tests for both fixes (map + parallel): inline-results-on-parent-payload, and reconstruct-from-inline-summary-without-child-ops (the pruned-resume scenario).
  • Validated end-to-end via the multi-language conformance suite against the deployed patched SDK: map 17/17 covered tests pass (9-14/9-19/9-20 uncovered by design — no serdes slots in .NET MapConfig), parallel 21/21 pass (no regression from the shared ConcurrentOperation change).

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…it results

Two conformance issues found via cross-SDK testing (JS/Python/Java reference SDKs):

1. Map iteration child contexts used SubType "MapItem"; the JS/Python/Java SDKs
   all use "MapIteration". Renamed OperationSubTypes.MapItem ->
   OperationSubTypes.MapIteration and its wire value.

2. Nested Parallel/Map only persisted per-unit results on the children's own
   CONTEXT checkpoints, not inline on the parent SUCCEED payload. The service
   collapses completed per-unit child contexts out of the state returned on a
   later (post-operation) resume, so a batch that completes and then suspends
   (e.g. a wait after the map) reconstructed [null, ...] on replay. Now each
   dispatched unit's result/error is recorded inline on the parent summary for
   both Nested and Flat (mirroring the JS SDK's default BatchResult serdes).
   The overflow-strip + ReplayChildren path now applies to both nesting modes.

Adds unit tests for both fixes (map + parallel). Full DurableExecution unit
suite passes (412/412). Validated end-to-end against the multi-language
conformance suite (map 17/17 covered, parallel 21/21).
@GarrettBeatty GarrettBeatty marked this pull request as ready for review July 14, 2026 15:38
@GarrettBeatty GarrettBeatty requested review from a team as code owners July 14, 2026 15:38
@GarrettBeatty GarrettBeatty requested review from normj and philasmar July 14, 2026 15:38
@GarrettBeatty GarrettBeatty merged commit 4295ad8 into dev Jul 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants