anishshiva7 opened a new pull request, #9656: URL: https://github.com/apache/texera/pull/9656
### What changes were proposed in this PR? **Root cause:** `OutputManager.emit_ecm(to, ecm)` flushes the partitioner of every output link once per output channel. Every partitioner except `OneToOnePartitioner` yields only when `to` is one of its receivers. `OneToOnePartitioner.flush` ignored `to`, so the first channel flushed took the one-to-one link's pending tuples, and every other channel got an extra copy of the ECM. ``` Before: emit_ecm(R1) -> round-robin: ECM + one-to-one: [pending tuples], ECM After: emit_ecm(R1) -> round-robin: ECM (one-to-one answers only for its own receiver C) ``` | File | Change | | --- | --- | | `one_to_one_partitioner.py` | `flush` returns nothing when `to` is not the link's receiver, and leaves the batch pending. `receiver` defaults to `None`. | | `input_port_materialization_reader_runnable.py` | The reader built its `OneToOnePartitioner` with its own (receiving) identity as an `ActorVirtualIdentity`, where the partitioner expects the sender's name, so `receiver` was never set. It worked only because `flush` ignored `to`. The reader now passes the sender of the channel that ends at this worker. | ### Any related issues, documentation, discussions? Closes #8698. The broadcast partitioner's shared-batch issue (#8189) is a separate, already claimed issue and is not touched here. ### How was this PR tested? New regression tests (red before the fix, green after): | Test | Covers | | --- | --- | | `TestOneToOnePartitioner::test_flush_to_non_receiver_emits_nothing_and_keeps_batch` | negative: a flush for another channel emits nothing and keeps the batch | | `TestOneToOnePartitioner::test_pending_batch_goes_to_receiver_after_other_channels_flush` | ordering: R1, R2, then the receiver; only the receiver gets batch + ECM | | `TestOneToOnePartitioner::test_flush_to_receiver_twice_sends_batch_once` | no duplicate batch | | `TestEmitEcmWithOneToOneLink` (OutputManager, parametrized over R1/R2/C, plus an unknown channel) | each channel gets exactly one ECM; an unknown channel gets none | The existing `test_state_materialization_e2e.py` exercises the reader change. ``` cd amber/src/main/python python -m pytest ../../test/python/core/architecture/sendsemantics ../../test/python/core/architecture/packaging ../../test/python/core/storage/runnables # 129 passed ruff check . && ruff format --check . ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
