Github user aweisberg commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/184#discussion_r163063411
--- Diff: src/java/org/apache/cassandra/db/SystemKeyspace.java ---
@@ -607,39 +672,65 @@ public static long getTruncatedAt(TableId id)
/**
* Record tokens being used by another node
*/
- public static synchronized void updateTokens(InetAddress ep,
Collection<Token> tokens)
+ public static synchronized void updateTokens(InetAddressAndPort ep,
Collection<Token> tokens)
{
- if (ep.equals(FBUtilities.getBroadcastAddress()))
+ if (ep.equals(FBUtilities.getBroadcastAddressAndPort()))
return;
String req = "INSERT INTO system.%s (peer, tokens) VALUES (?, ?)";
- executeInternal(format(req, PEERS), ep, tokensAsSet(tokens));
+ executeInternal(String.format(req, LEGACY_PEERS), ep.address,
tokensAsSet(tokens));
+ req = "INSERT INTO system.%s (peer, peer_port, tokens) VALUES (?,
?, ?)";
+ executeInternal(String.format(req, PEERS_V2), ep.address, ep.port,
tokensAsSet(tokens));
}
- public static synchronized void updatePreferredIP(InetAddress ep,
InetAddress preferred_ip)
+ public static synchronized void updatePreferredIP(InetAddressAndPort
ep, InetAddressAndPort preferred_ip)
{
if (getPreferredIP(ep) == preferred_ip)
return;
String req = "INSERT INTO system.%s (peer, preferred_ip) VALUES
(?, ?)";
- executeInternal(format(req, PEERS), ep, preferred_ip);
- forceBlockingFlush(PEERS);
+ executeInternal(String.format(req, LEGACY_PEERS), ep.address,
preferred_ip.address);
+ forceBlockingFlush(LEGACY_PEERS);
--- End diff --
Hah wow that came out buggy and more passive aggressive then I intended.
Anyways I added a commit with this. We don't call forceBlockingFlush a lot so I
think it's fine.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]