apache / apache/texera

Duplicate channels can crash range shuffle routing

Open
#8,245 1 comment 0 reactions 1 assignee Claimed by @carloea2 View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Feature Summary

Range shuffle deduplicates downstream receivers but divides the key range by the original channel count. Repeated topology channels can therefore produce a receiver index beyond the deduplicated receiver list and crash on a valid key.

Before: four channels to two unique receivers compute index 3 and raise IndexError

After: the range uses two unique receivers and routes the maximum key to receiver B

Range calculation should use the same unique receiver list used for routing, so every valid key maps to an existing receiver.

Reproduction evidence:

Configure range 0 through 9 with channels to A, A, A, and B, then route key 9.

Observed result:

```text
channels=4 receivers=2 keys_per_receiver=3 index_for_9=3
IndexError: list index out of range
```

Version and commit evidence:

1.3.0-incubating-SNAPSHOT (main)

**Commit Hash (Optional)**

`50321e403c82df299a13deb50a7f9849dd93bdba`

### Proposed Solution or Design

After: the range uses two unique receivers and routes the maximum key to receiver B

### Affected Area

Workflow Engine (Amber)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.