You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "David Viner (JIRA)" <ji...@apache.org> on 2010/08/31 05:56:53 UTC

[jira] Created: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

PropertyFileEndPointSnitch can only be used once per configuration
------------------------------------------------------------------

                 Key: CASSANDRA-1448
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
             Project: Cassandra
          Issue Type: Bug
          Components: Contrib
    Affects Versions: 0.7 beta 1, 0.6.5, 0.6.4
         Environment: Debian
            Reporter: David Viner


When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:

ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null

This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.

Patch file to follow.

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


[jira] Updated: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

David Viner updated CASSANDRA-1448:
-----------------------------------

    Comment: was deleted

(was: Simple patch to catch the exception)

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

David Viner commented on CASSANDRA-1448:
----------------------------------------

Happy to make that change... although that would require a list (somewhere) of the set of mbean names in use... is that available to the callers of the mbean -> reload()?

Also, in the snitch constructor, how would I determine what keyspace is being used?  The constructor doesn't appear to get any parameters.  Is there a global config object that I could access or some such?

Or, since this whole point is moot for 0.7.x in the PropertyFileEndPointSnitch, is this really a moot issue?  It might impact other areas, per the discussion on the irc channel (e.g., dynamic eps).  But that's an issue for a separate bug.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams commented on CASSANDRA-1448:
---------------------------------------------

That sounds reasonable to me.  I can't envision a scenario where you'd use one config for keyspace A, and another for keyspace B, anyway.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Resolved: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Jonathan Ellis resolved CASSANDRA-1448.
---------------------------------------

      Assignee:     (was: Brandon Williams)
    Resolution: Won't Fix

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5
>         Environment: Debian
>            Reporter: David Viner
>            Priority: Minor
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Jonathan Ellis commented on CASSANDRA-1448:
-------------------------------------------

probably the right solution is to include the keyspace name in the mbean signature so you can actually have more than one

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams commented on CASSANDRA-1448:
---------------------------------------------

I don't think I can support wontfix  here.  The reason David opened this ticket is that, with two keyspaces, he receives an exception on startup which prevents Cassandra from running, so using multiple keyspaces with PFEPS is currently impossible.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams commented on CASSANDRA-1448:
---------------------------------------------

It is being instantiated in DatabaseDescriptor.java, near line 635 which is what is throwing.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams commented on CASSANDRA-1448:
---------------------------------------------

I'm going to table this issue.  There are only a few options I see for this: special casing the PFEPS instantiation, or changing the endpoint interface so that there is a method we can pass the keyspace to (which could possibly break any other custom snitches people are using in 0.6)  There is a compromise where we could add something unique to the mbean name, but you wouldn't be able to tell which snitch belonged to a keyspace.  None of these seem very attractive, and this issue does not affect 0.7, so anything we do here will just add pain to merges.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Jonathan Ellis commented on CASSANDRA-1448:
-------------------------------------------

you don't need a list of names-in-use because each snitch's name will be unique once its contains the KS

you'd have to pass the KS in somehow, yes

i'm happy to close this as wontfix for 0.6 if you are :)

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Assigned: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams reassigned CASSANDRA-1448:
-------------------------------------------

    Assignee: Brandon Williams

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Updated: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams updated CASSANDRA-1448:
----------------------------------------

        Fix Version/s:     (was: 0.6.6)
    Affects Version/s:     (was: 0.7 beta 1)

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Jonathan Ellis commented on CASSANDRA-1448:
-------------------------------------------

alternatively you could disassociate the mbean from the PFEPS itself

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

David Viner commented on CASSANDRA-1448:
----------------------------------------

what is the calling sequence for the EndpointSnitch ?

Is there an init() method or any other method called after the constructor in which the object has a chance to take some action before it's actually put into service?

(I am not sure where in the codebase the snitchs are actually constructed.)

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Updated: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Brandon Williams updated CASSANDRA-1448:
----------------------------------------

    Priority: Minor  (was: Major)

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>            Priority: Minor
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Updated: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

David Viner updated CASSANDRA-1448:
-----------------------------------

    Attachment: patch-for-mbean-error.patch

This patch is against the 0.6.4 source tag.  However, it should apply equally to the 0.6.5 tree.

The 0.7.x tree does not need this patch, since that code appears to have taken out the mbean class entirely.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

David Viner commented on CASSANDRA-1448:
----------------------------------------

hmm... good point.

Perhaps the better approach would be to call "getObjectInstance" in the constructor.  If that returned an InstanceNotFound, then run the constructor as it stands.  If it returns an instance, then set this == that;

Would that work better?

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

David Viner commented on CASSANDRA-1448:
----------------------------------------

I am not an mbean expert... but it would seem that we actually only need 1 snitch object per cassandra node.  If there are 2 keyspaces and both use PFEPS, there is no reason not to reuse the same object managed by the MBeanServer for both keyspaces.

In the 0.6.x codebase, there is no configuration of the PFEPS at all.  The path to the rack.properties file is hardcoded and can not be changed dynamically AFAICT.  Essentially the only property here is the path to the config file and when/if to reload that property file.  Different keyspaces can not use different property files.

Given that, I don't think we need a keyspace-specific snitch in this case.  If the property file changes, it would be applicable to all keyspaces.

Therefore, it would seem reasonable for the constructor to call to the mbean server first to see if there is a pre-existing object for the endpoint name.  If so, then we reuse that.  If not, then we construct a new one and register it with the mbean server.

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Jonathan Ellis commented on CASSANDRA-1448:
-------------------------------------------

no, you can't singleton-ify a class in its constructor, you'd have to use a factory method

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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


[jira] Commented: (CASSANDRA-1448) PropertyFileEndPointSnitch can only be used once per configuration

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

Jonathan Ellis commented on CASSANDRA-1448:
-------------------------------------------

I don't think this is the right fix -- the point of the mbean is so you can tell PFEPS to reload its config, which obviously doesn't work if you have multiple snitch objects but only one is connected to the mbean.

(0.7 makes the snitch global, among other changes.)

> PropertyFileEndPointSnitch can only be used once per configuration
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-1448
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1448
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Contrib
>    Affects Versions: 0.6.4, 0.6.5, 0.7 beta 1
>         Environment: Debian
>            Reporter: David Viner
>            Assignee: Brandon Williams
>             Fix For: 0.6.6
>
>         Attachments: patch-for-mbean-error.patch
>
>
> When a user configures a node to have more than one keyspace, and two keyspaces uses PropertyFileEndPointSnitch as the EndpointSnitch, Cassandra throws an error on startup saying:
> ERROR [main] 2010-08-30 23:55:23,402 DatabaseDescriptor.java (line 536) Fatal error: Invalid endpointsnitch class org.apache.cassandra.locator.PropertyFileEndPointSnitch null
> This appears to be directly tied to the use of MBeanServer.registerMBean().  If more than one instance is tied to the mbean server, it will return an InstanceAlreadyExistsException.  Since this appears to be a valid exception, but causes no errors in operation, the snitch should catch it and continue on.
> Patch file to follow.

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