Elffuss BraidHub

kikocis/java-driver public

Fix schema agreement bug in JAVA-852.

The isValidPeer check in checkSchemaAgreement requires the presence of
columns that weren't returned in SELECT_SCHEMA_PEERS.  Updated to use
SELECT_PEERS as we want to only valid peers are considered.
Changesetd95a45e479a7167e0cfae0e50c89346e7413f4715f6ece5080cd1e80bd868eed
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-03-10 16:55 -06:00
Committerolim7t <omichallat+github@gmail.com> · 2016-03-15 10:31 +01:00
Parents23c646c58e54

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +3 −7
@@ -427,10 +427,9 @@
427427 InetAddress peer = peersRow.getInet("peer");
428428 InetAddress addr = peersRow.getInet("rpc_address");
429429
430- // We've already called isValid on the row, which checks this
431- assert addr != null;
432-
433- if (peer.equals(connectedHost.getAddress()) || addr.equals(connectedHost.getAddress())) {
430+ if (addr == null) {
431+ return null;
432+ } else if (peer.equals(connectedHost.getAddress()) || addr.equals(connectedHost.getAddress())) {
434433 // Some DSE versions were inserting a line for the local node in peers (with mostly null values). This has been fixed, but if we
435434 // detect that's the case, ignore it as it's not really a big deal.
436435 logger.debug("System.peers on node {} has a line for itself. This is not normal but is a known problem of some DSE version. Ignoring the entry.", connectedHost);
@@ -733,9 +732,6 @@
733732
734733 for (Row row : peersFuture.get()) {
735734
736- if (!isValidPeer(row, false))
737- continue;
738-
739735 InetSocketAddress addr = addressToUseForPeerHost(row, connection.address, cluster);
740736 if (addr == null || row.isNull("schema_version"))
741737 continue;