Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SFN] Execution of Reentrant Distributed Map States #10763

Merged
merged 3 commits into from
May 8, 2024

Conversation

MEPalma
Copy link
Contributor

@MEPalma MEPalma commented May 3, 2024

Motivation

Currently the StepFunctions v2 interpreter is unable to execute reentrant distributed map states. This is due to a lack of end of evaluation cleanups, which means the workers activate logic does not start any new workers. This PR addresses such issue and adds relevant snapshot tests. Addresses: #10662

Changes

  • Added member cleanups at the end of distributed map evaluation
  • Added relevant snapshot tests

@MEPalma MEPalma added the semver: patch Non-breaking changes which can be included in patch releases label May 3, 2024
@MEPalma MEPalma added this to the 3.5 milestone May 3, 2024
@MEPalma MEPalma self-assigned this May 3, 2024
@MEPalma MEPalma requested a review from joe4dev May 3, 2024 13:55
Copy link

github-actions bot commented May 3, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 37m 29s ⏱️ +18s
2 932 tests +6  2 638 ✅ +4  294 💤 +2  0 ❌ ±0 
2 934 runs  +6  2 638 ✅ +4  296 💤 +2  0 ❌ ±0 

Results for commit 9f9c75d. ± Comparison against base commit 3c06fd4b.

This pull request removes 5 and adds 11 tests. Note that renamed tests count towards both.
tests.aws.services.events.test_events.TestEvents ‑ test_event_pattern
tests.aws.services.events.test_events.TestEvents ‑ test_put_event_without_source
tests.aws.services.events.test_events.TestEvents ‑ test_put_events_with_nested_event_pattern
tests.aws.services.events.test_events.TestEvents ‑ test_put_events_with_values_in_array
tests.aws.services.events.test_events.TestEvents ‑ test_put_target_id_validation
tests.aws.services.cloudformation.api.test_stacks.TestStacksApi ‑ test_update_stack_with_same_template_withoutchange_transformation
tests.aws.services.events.test_event_patterns ‑ test_event_pattern_source
tests.aws.services.events.test_events.TestEventPattern ‑ test_put_events_pattern_nested
tests.aws.services.events.test_events.TestEventPattern ‑ test_put_events_pattern_with_values_in_array
tests.aws.services.events.test_events.TestEventTarget ‑ test_put_target_id_validation
tests.aws.services.events.test_events.TestEvents ‑ test_put_events_without_source
tests.aws.services.sqs.test_sqs.TestSqsProvider ‑ test_marker_serialization_json_protocol["{\\"foo\\": \\"ba\\rr\\"}"]
tests.aws.services.sqs.test_sqs.TestSqsProvider ‑ test_marker_serialization_json_protocol[{"foo": "ba\rr", "foo2": "ba"r""}]
tests.aws.services.stepfunctions.v2.scenarios.test_base_scenarios.TestBaseScenarios ‑ test_map_state_config_distributed_reentrant
tests.aws.services.stepfunctions.v2.scenarios.test_base_scenarios.TestBaseScenarios ‑ test_map_state_config_distributed_reentrant_lambda
…
This pull request skips 1 test.
tests.aws.services.events.test_events.TestEvents ‑ test_put_event_without_detail

♻️ This comment has been updated with latest results.

Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

I added a small suggestion for a comment to clarify the intent of the test scenarios.

# Replace MapRunArns with fixed values to circumvent random ordering issues.
sfn_snapshot.add_transformer(
JsonpathTransformer(
jsonpath="$..mapRunArn", replacement="map_run_arn", replace_reference=False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you manually check (e.g., using SNAPSHOT_RAW=1) that we return the correct ARN in the right format here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm we do produce the correct ARN format, and we do have tests that validate this aspect of MapRuns. However, here I decided to skip this check to avoid crowding the test state with ordering reordering logic. We can however still validate that for each map input the correct output (and events) are computed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasonable. No need to double-check if we have other tests covering this part 💯

@MEPalma MEPalma merged commit 89257bf into master May 8, 2024
30 checks passed
@MEPalma MEPalma deleted the MEP-sfn-dist_map_rerun branch May 8, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants