You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "ZhaoYang (Jira)" <ji...@apache.org> on 2020/04/01 12:34:00 UTC
[jira] [Updated] (CASSANDRA-15665) StreamManager should clearly
differentiate between "initiator" and "receiver" sessions
[ https://issues.apache.org/jira/browse/CASSANDRA-15665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ZhaoYang updated CASSANDRA-15665:
---------------------------------
Test and Documentation Plan: CI pending: [https://circleci.com/workflow-run/896f8753-3b8a-47ed-959e-f2806ae3d052]
Status: Patch Available (was: In Progress)
[Patch|https://github.com/jasonstack/cassandra/pull/10] on top of CASSANDRA-15666:
* Include {{isFollower}} flag into {{StreamMessageHeader}}. On the receiver side, it will use initiator session if message is sent by a follower or use follower session if message is sent by an initiator.
* Added a base method {{getOrCreateSession}} to {{StreamMessage}}:
** it throws unsupported operation by default
** {{StreamInitMessage}} will initialize a follower {{StreamResultFuture}}/{{StreamSession}}
** {{IncomingStreamMessage}} will just return the stream session taken from {{IncomingStreamMessage#serializer#deserialize}}
> StreamManager should clearly differentiate between "initiator" and "receiver" sessions
> --------------------------------------------------------------------------------------
>
> Key: CASSANDRA-15665
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15665
> Project: Cassandra
> Issue Type: Bug
> Components: Legacy/Streaming and Messaging
> Reporter: Sergio Bossa
> Assignee: ZhaoYang
> Priority: Normal
> Fix For: 4.0
>
>
> {{StreamManager}} does currently a suboptimal job in differentiating between stream sessions (in form of {{StreamResultFuture}}) which have been either initiated or "received", for the following reasons:
> 1) Naming is IMO confusing: a "receiver" session could actually both send and receive files, so technically an initiator is also a receiver.
> 2) {{StreamManager#findSession()}} assumes we should first looking into "initiator" sessions, then into "receiver" ones: this is a dangerous assumptions, in particular for test environments where the same process could work as both an initiator and a receiver.
> I would recommend the following changes:
> 1) Rename "receiver" with "follower" everywhere the former is used.
> 2) Introduce a new flag into {{StreamMessageHeader}} to signal if the message comes from an initiator or follower session, in order to correctly differentiate and look for sessions in {{StreamManager}}.
> While my arguments above might seem trivial, I believe they will improve clarity and save from potential bugs/headaches at testing time, and doing such changes now that we're revamping streaming for 4.0 seems the right time.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org