Repository navigation
[Data] Cap number of kills for lineage reconstruction release test - #68378
Merged
goutamvenkat-anyscale merged 1 commit intoNov 24, 2026
Merged
goutamvenkat-anyscale merged 1 commit into
goutamvenkat-anyscale merged 1 commit into
Conversation
Signed-off-by: Ayush Kumar <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the manual test image_embedding_from_uris_fake_gpu_lineage_reconstruction_chaos in release/release_data_tests.yaml to run as a matrix test over different max_kills values (8, 16, and 30). It parameterizes the test name and adds the --chaos-max-kills argument to the test execution command. There are no review comments, and I have no additional feedback to provide.
AarryaSaraf
approved these changes
Nov 20, 2026
sampan-s-nayak
approved these changes
Nov 20, 2026
goutamvenkat-anyscale
approved these changes
Nov 24, 2026
goutamvenkat-anyscale
enabled auto-merge (squash)
November 24, 2026 18:20
sampan-s-nayak
added a commit
that referenced
this pull request
Nov 25, 2026
…inal task index (#68400) ## Summary A lineage reconstruction task now runs with the `TaskContext.task_idx` of the task it re-runs. Before, it got a fresh index, so a re-run `Write` added a second file instead of replacing the first, and seeded operations drew different values. ## Before `TaskContext.task_idx` came from the operator's submission counter, `_next_data_task_idx`, which goes up on every submission, including reconstruction tasks. Several things are keyed on that index, and assume a re-run of the same task sees the same value: - **File writes.** `FilenameProvider` names a file `{write_uuid}_{task_index}`, and its contract says names "must be unique and deterministic for a given write UUID and task index". Parquet writes with `existing_data_behavior="overwrite_or_ignore"`. A Ray Core retry resends the same `TaskContext`, so it overwrites its own file. A reconstruction task got a new index, so it wrote a new file. If the failed attempt's file had already landed (for example, the node died after the upload but before the driver heard back), both files stayed, and the output had duplicated rows. Ray Data's own `Data sink ... finished. N rows` count stays correct, because it only counts the attempt it saw finish. - **Seeded and indexed values.** `random_sample(seed=...)`, `streaming_train_test_split(seed=...)`, the `random(seed=...)` expression and `monotonically_increasing_id()` all derive from the index, so a re-run produced different rows, values or IDs. Reconstruction also assumes a re-run reproduces its output block for block, since it skips blocks that were already delivered downstream. We hit the write case in a chaos release test (`image_embedding_from_uris_fake_gpu_lineage_reconstruction_chaos`, actor-only backend): the output check found 1,326 duplicated rows (41 images written twice), while the sink reported exactly the expected 2,484,000 rows. ## After `MapOperator._context_task_idx(inputs)` picks the index for the task's `TaskContext`. For a bundle that carries a `reconstruction_stamp`, it is the original index, read back from the stamp's lineage task ID (`{op_id}:{task_index}`). Otherwise it is the next counter value, as before. All three ways of submitting a map task use it: the task pool, the actor pool and the experimental actor-only pool. The operator's own bookkeeping (the in-flight task map, `preserve_order` output keys) still uses the fresh counter, so a re-run never shares a key with the attempt it replaces. A re-run `Write` now overwrites the failed attempt's file, and seeded operations reproduce their original output. ```mermaid flowchart TD subgraph Before subgraph BS[Subsystem: execution] subgraph BC[Component: MapOperator task submission] B1[reconstruction bundle] --> B2["TaskContext.task_idx = _next_data_task_idx (new)"] B2 --> B3["Write: new file {uuid}_{new}"] end end end subgraph After subgraph AS[Subsystem: execution] subgraph AC[Component: MapOperator task submission] A1[reconstruction bundle] --> A2["TaskContext.task_idx = original index from reconstruction_stamp"] A2 --> A3["Write: overwrites {uuid}_{original}"] end end end classDef changed fill:#fff9c4,stroke:#f9a825,color:#000 class A2,A3 changed ``` ## Subsystems Execution (map operator task submission). The three operator edits pass the input bundle through so the helper can read its stamp. ## Not a duplicate I searched open PRs for `task_idx`, "lineage reconstruction" with "write" or "duplicate", "idempotent write" and "reconstruction task index". The open Data fault-tolerance PRs (#68094, #68337, #68378) don't change the task index. ## Testing - `pytest python/ray/data/tests/unit/test_lineage_reconstruction_executor.py`: 6 passed, including the new `test_reconstruction_task_context_reuses_the_original_task_index`. - `pre-commit` on the changed files: passes. `pyrefly-data` was run separately with the hidden-directory exclusion turned off, because the branch lives in a worktree under a dot-directory. It reports no errors on changed lines. - **Not run yet:** the two new end-to-end tests in `test_lineage_reconstruction.py` (`test_re_run_write_overwrites_the_file_of_the_failed_attempt` and `test_re_run_draws_the_same_seeded_random_sample`). My local Ray build doesn't match this branch, so workers fail at startup for every test in that file, including existing ones. I'm building a matching one. I'll run both tests with and without the fix, and keep this PR in draft until they pass. AI assistance (Claude Code) was used to investigate and write this change. I've reviewed it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: sampan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
image_embedding_from_uris_fake_gpu_lineage_reconstruction_chaos(added in #67519) runs chaos with no limit on kills. Chaos continues for the whole run, re-executed work keeps adding to the runtime, and the run can hit the timeout.This PR passes
--chaos-max-killsthrough amax_killsmatrix of 8, 16 and 30. 16 is the default to run. Each round kills 2 raylets (--chaos-kill-batch-size 2), so the caps are even and the limit lands exactly on the cap.The test is renamed to
image_embedding_from_uris_fake_gpu_lineage_reconstruction_chaos_kills_{8,16,30}. It's stillfrequency: manual.Related issue number
Follow-up to #67519. No open PR covers this.
Testing
Parsed and schema-validated
release/release_data_tests.yamlwithray_release.config.parse_test_definitionandvalidate_release_test_collection. The matrix expands into the 3 tests, and each one passes the matching--chaos-max-kills.AI assistance (Claude Code) was used for this change.
🤖 Generated with Claude Code