You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Per Mellqvist (JIRA)" <ji...@apache.org> on 2009/04/10 22:19:15 UTC

[jira] Created: (CASSANDRA-74) Random port (5555) hardcoded

Random port (5555) hardcoded
----------------------------

                 Key: CASSANDRA-74
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
             Project: Cassandra
          Issue Type: Improvement
    Affects Versions: trunk
            Reporter: Per Mellqvist
            Priority: Minor


The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Michael Greene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Greene updated CASSANDRA-74:
------------------------------------

    Component/s: Core

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Per Mellqvist
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 0.4
>
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Michael Greene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731138#action_12731138 ] 

Michael Greene commented on CASSANDRA-74:
-----------------------------------------

That sounds good to me; that's the way I was reading it as well.

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Per Mellqvist
>            Assignee: Chris Goffinet
>            Priority: Minor
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716306#action_12716306 ] 

Jonathan Ellis commented on CASSANDRA-74:
-----------------------------------------

any idea wtf randomPort is used for?  can we name it more descriptively?

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: trunk
>            Reporter: Per Mellqvist
>            Priority: Minor
>             Fix For: 0.4
>
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722236#action_12722236 ] 

Jonathan Ellis commented on CASSANDRA-74:
-----------------------------------------

I don't think GossipPort is entirely accurate -- doesn't Gossip use the normal UDP channel for some things?

/could be wrong

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Per Mellqvist
>            Assignee: Chris Goffinet
>            Priority: Minor
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Michael Greene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726262#action_12726262 ] 

Michael Greene commented on CASSANDRA-74:
-----------------------------------------

I don't see a reason to make this configurable.  I haven't seen Cassandra ever try to bind on this port; it looks like it is just used as a flag of sorts for certain types of messages.  It really *is* a randomPort, or rather a *throwAwayPort*.

In the definition of the protocol header, there's this comment that may or may not elucidate (it didn't help me much): "The 5th bit is used to indicate that the sender is not listening on any well defined port. This implies the receiver needs to cache the connection using the port on the socket."  The 5th bit is the 'listening' bit, and we use this randomEndPoint when we see the listening bit set.

I never actually see a later test for this port so that we might explicitly cache that connection, but this code is still throwing me for loops, so what do I know.

It doesn't seem to be used by the Gossiper at all.

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Per Mellqvist
>            Assignee: Chris Goffinet
>            Priority: Minor
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731416#action_12731416 ] 

Hudson commented on CASSANDRA-74:
---------------------------------

Integrated in Cassandra #138 (See [http://hudson.zones.apache.org/hudson/job/Cassandra/138/])
    rename confusing "random" magic number variables.  patch by jbellis; reviewed by Michael Greene for 


> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Per Mellqvist
>            Assignee: Jonathan Ellis
>            Priority: Minor
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Chris Goffinet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Goffinet updated CASSANDRA-74:
------------------------------------

    Attachment: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch

Removed hardcoded port (5555) and moved to storage-conf.xml

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: trunk
>            Reporter: Per Mellqvist
>            Priority: Minor
>             Fix For: 0.4
>
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Johan Oskarsson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722232#action_12722232 ] 

Johan Oskarsson commented on CASSANDRA-74:
------------------------------------------

Looks good to me. Should we change the name of randomLocalEndPoint_ in EndPoint.java while we're at it?

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Per Mellqvist
>            Assignee: Chris Goffinet
>            Priority: Minor
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Chris Goffinet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Goffinet updated CASSANDRA-74:
------------------------------------

    Attachment: 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch

Renamed RandomPort to GossipPort

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: trunk
>            Reporter: Per Mellqvist
>            Priority: Minor
>             Fix For: 0.4
>
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731137#action_12731137 ] 

Jonathan Ellis commented on CASSANDRA-74:
-----------------------------------------

here are the keys to understanding this

in tcpconnection,

                        /* first message received */
                        if (remoteEp_ == null)
                        {             
                            int port = ( pH.isListening_ ) ? DatabaseDescriptor.getStoragePort() : EndPoint.randomPort_;
                            remoteEp_ = new EndPoint( socketChannel_.socket().getInetAddress().getHostAddress(), port );                            
                            // put connection into pool if possible
                            pool_ = MessagingService.getConnectionPool(localEp_, remoteEp_);                            
                            pool_.addToPool(TcpConnection.this);                            
                        }

and in the message handling,

            boolean listening = !message.getFrom().equals(EndPoint.randomLocalEndPoint_);

so it's some weird-ass way of setting itself to a different state.

let's rename them to sentinelLocalEndpoint and sentinelPort.  sound good?

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Per Mellqvist
>            Assignee: Chris Goffinet
>            Priority: Minor
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-74:
------------------------------------

    Fix Version/s: 0.4

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: trunk
>            Reporter: Per Mellqvist
>            Priority: Minor
>             Fix For: 0.4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CASSANDRA-74) Random port (5555) hardcoded

Posted by "Chris Goffinet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Goffinet reassigned CASSANDRA-74:
---------------------------------------

    Assignee: Chris Goffinet

> Random port (5555) hardcoded
> ----------------------------
>
>                 Key: CASSANDRA-74
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-74
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: trunk
>            Reporter: Per Mellqvist
>            Assignee: Chris Goffinet
>            Priority: Minor
>             Fix For: trunk
>
>         Attachments: 0001-Removed-hardcoded-port-5555-and-moved-to-storage-con.patch, 0002-Renamed-random-port-to-gossip-port-and-moved-to-stor.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The EndPoint class contains a "random port" currently hard coded to 5555. The cassandra process will attempt to bind on this port, another process already using 5555 will interfere with this. The port should be configurable.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.