Skip to content

fix(index): report shuffle-stage failures instead of panicking - #9405

Open
LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-shuffle-joinerror
Open

LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-shuffle-joinerror

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Closes #9404

Two steps of the same failure. Attaching precomputed partition ids to a batch that already has __ivf_part_id hit try_with_column's duplicate-name error behind an .expect, so it panicked inside the spawned transform task; the stream then unwrapped the resulting JoinError, re-raising that panic in the consumer instead of returning it from build(). The attach now returns an invalid_input error naming the batch schema, and both shuffle streams (shuffle_data and reshuffle_partitions) turn a JoinError into an error rather than unwrapping it.

The JoinError mapping is the safety net for any other panic in that closure, so it stays even though the one reachable panic is now handled at the source.

How was this patch tested?

test_shuffle_data_reports_duplicate_partition_id_column drives shuffle_data with a precomputed partitions file and a batch that already carries the partition column, and asserts the error names the attach. Restoring the .expect makes the test fail with the error the JoinError mapping produces, shuffle transform task failed: task N panicked with message "failed to add part id column: ...", which is the mapping doing its job; restoring both lines makes the panic escape the stream again.

Two streaming shuffle paths unwrapped tokio::spawn JoinHandle results
(.map(|x| x.unwrap())), so a panic inside a transform task re-panicked
in the pipeline and aborted the process instead of surfacing as a
lance Error. Convert JoinError into Error::internal.

Assisted-by: GLM-5.3
@github-actions github-actions Bot added the bug Something isn't working label Sep 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gate recommendation: approve.

The change handles the reachable duplicate-column failure at its source and prevents both shuffle streams from re-panicking on transform-task failures, while preserving their existing concurrency and ordering. The focused regression test covers the invalid-input path and its diagnostic context.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026
@LuciferYang

Copy link
Copy Markdown
Contributor Author

mac-build failed in lance-index::vector::kmeans::tests::test_hierarchical_kmeans_is_seeded_and_balanced, a size-balance assertion in the kmeans trainer. This PR only touches the shuffle streams in rust/lance/src/index/vector/builder.rs, so it cannot reach that test; it passes locally on this branch. Every other job is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: a panic in the shuffle transform aborts the build instead of returning an error

1 participant