You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sam Overton (JIRA)" <ji...@apache.org> on 2013/01/07 12:02:13 UTC
[jira] [Commented] (CASSANDRA-5121) system.peers.tokens is empty
after node restart
[ https://issues.apache.org/jira/browse/CASSANDRA-5121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13545782#comment-13545782 ]
Sam Overton commented on CASSANDRA-5121:
----------------------------------------
In StorageService.handleStateNormal, when we see an endpoint come up which we already knew about:
{noformat}
else if (endpoint.equals(currentOwner))
{
// set state back to normal, since the node may have tried to leave, but failed and is now back up
// no need to persist, token/ip did not change
{noformat}
I think the bug is that then we call
{noformat}
SystemTable.updateTokens(endpoint, tokensToUpdateInSystemTable);
{noformat}
with an empty collection and SystemTable.updateTokens overwrites the current entry rather than adding to it.
Fix would be
{noformat}
- // no need to persist, token/ip did not change
+ if (!isClientMode)
+ tokensToUpdateInSystemTable.add(token);
{noformat}
> system.peers.tokens is empty after node restart
> -----------------------------------------------
>
> Key: CASSANDRA-5121
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5121
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.0
> Environment: Windows 8 / Java 1.6.0_37-b06
> Reporter: Pierre Chalamet
> Priority: Minor
>
> Using a 2 nodes fresh cluster (127.0.0.1 & 127.0.0.2) running latest 1.2, I’m querying system.peers to get the nodes of the cluster and their respective token. But it seems there is a problem after either node restart.
> When both node starts up, querying system.peers seems ok:
> {code}
> 127.0.0.1> select * from system.peers;
> +-----------------+------------------------------------------+---------------+-----------+---------------------+-----------------+------------------------------------------+-------------------------------------------+
> | data_center | host_id | peer | rack | release_version | rpc_address | schema_version | tokens |
> +=================+==========================================+===============+===========+=====================+=================+==========================================+===========================================+
> | datacenter1 | 4819cbb0-9741-4fe0-8d7d-95941b0247bf | 127.0.0.2 | rack1 | 1.2.0 | 127.0.0.2 | 59adb24e-f3cd-3e02-97f0-5b395827453f | 56713727820156410577229101238628035242 |
> +-----------------+------------------------------------------+---------------+-----------+---------------------+-----------------+------------------------------------------+-------------------------------------------+
> {code}
> But as soon as one node is restarted (let’s say 127.0.0.2), tokens column is then empty:
> {code}
> 127.0.0.1> select * from system.peers;
> +-----------------+------------------------------------------+---------------+-----------+---------------------+-----------------+------------------------------------------+-------------+
> | data_center | host_id | peer | rack | release_version | rpc_address | schema_version | tokens |
> +=================+==========================================+===============+===========+=====================+=================+==========================================+=============+
> | datacenter1 | 4819cbb0-9741-4fe0-8d7d-95941b0247bf | 127.0.0.2 | rack1 | 1.2.0 | 127.0.0.2 | 59adb24e-f3cd-3e02-97f0-5b395827453f | |
> +-----------------+------------------------------------------+---------------+-----------+---------------------+-----------------+------------------------------------------+-------------+
> {code}
> {code}
> Log server side:
> DEBUG 22:08:01,608 Responding: ROWS [peer(system, peers), org.apache.cassandra.db.marshal.InetAddressType][data_center(system, peers), org.apache.cassandra.db.marshal.UTF8Type][host_id(system, peers), org.apache.cassandra.db.marshal.UUIDType][rack(system, peers), org.apache.cassandra.db.marshal.UTF8Type][release_version(system, peers), org.apache.cassandra.db.marshal.UTF8Type][rpc_address(system, peers), org.apache.cassandra.db.marshal.InetAddressType][schema_version(system,
> peers), org.apache.cassandra.db.marshal.UUIDType][tokens(system, peers), org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.UTF8Type)]
> | 127.0.0.2 | datacenter1 | 4819cbb0-9741-4fe0-8d7d-95941b0247bf | rack1 | 1.2.0 | 127.0.0.2 | 59adb24e-f3cd-3e02-97f0-5b395827453f | null
> {code}
> Restarting the other node (127.0.0.1) restore back the tokens column.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira