[ 
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.

Reply via email to