leizhiyuan opened a new pull request, #1452:
URL: https://github.com/apache/rocketmq-clients/pull/1452

   ### Which Issue(s) This PR Fixes
   
   Fixes #1451
   
   ### Brief Description
   
   The assignment scan reconciled one shared actor table topic by topic, so 
processing topic B shut down every actor of topic A, and the next round 
restarted them (and stopped B's). Java `PushConsumerImpl#syncProcessQueue` 
skips the queues of other topics.
   
   - Actors are grouped by subscribed topic (`ActorTable = HashMap<String, 
HashMap<MessageQueue, MessageQueueActor>>`). Keyed by the subscription topic, 
not the assigned queue's topic name, which a server may decorate 
(`<instance>%<topic>`, see #1407).
   - Each topic's assignments only reconcile that topic's actors.
   - The scan body, duplicated in `start` and `start_with_telemetry`, is moved 
into one `scan_assignments` function, so the fix applies to `LitePushConsumer` 
too and can be unit tested. No other change in the moved code.
   
   #### Notes for reviewers
   
   - Conflicts with #1450's PR (same scan loop); suggested to merge this one 
first. See #1445.
   
   ### How Did You Test This Change?
   
   **Unit test**, fails on `master`:
   
   - `test_scan_assignments_keeps_actors_of_other_topics`: 2 topics, 3 scan 
rounds; both topics must have their actor, and only 2 actors may ever be 
started (master: only `topic_b` is left).
   
   **End-to-end** (mock proxy over real gRPC, topics `a` and `b`, one queue 
each, 75 s, 3 runs):
   
   | messages consumed a / b | |
   |---|---|
   | `master` | 0 / 373,790; 355,193 / 0; 192 / 350,091 |
   | this PR | 609,013 / 608,948; 607,122 / 607,261; 617,125 / 617,056 |
   
   
   ```
   $ cargo test                                                   # lib: 151 
passed, 0 failed (master: 150)
   $ cargo clippy --all-features -- -D warnings                   # clean
   $ cargo fmt --check                                            # clean
   $ RUSTDOCFLAGS='--cfg docsrs' cargo doc --no-deps --all-features   # ok
   $ cargo build --examples --all-features                        # ok
   $ cargo +1.74.0 check --all-features --tests --examples        # ok (MSRV)
   ```
   
   ---
   
   Part of #1445 (overview, end-to-end benchmark and merge order).
   


-- 
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]

Reply via email to