diff --git a/fdbrpc/FlowTransport.actor.cpp b/fdbrpc/FlowTransport.actor.cpp index 3e8c0f0337..25eeba0d6e 100644 --- a/fdbrpc/FlowTransport.actor.cpp +++ b/fdbrpc/FlowTransport.actor.cpp @@ -819,7 +819,7 @@ ACTOR Future connectionKeeper(Reference self, .detail("PeerAddr", self->destination); // Since the connection has closed, we need to check the protocol version the next time we connect - self->incompatibleProtocolVersionNewer = false; + self->compatible = true; } if (self->destination.isPublic() && @@ -889,9 +889,9 @@ ACTOR Future connectionKeeper(Reference self, Peer::Peer(TransportData* transport, NetworkAddress const& destination) : transport(transport), destination(destination), compatible(true), outgoingConnectionIdle(true), lastConnectTime(0.0), reconnectionDelay(FLOW_KNOBS->INITIAL_RECONNECTION_TIME), peerReferences(-1), - incompatibleProtocolVersionNewer(false), bytesReceived(0), bytesSent(0), lastDataPacketSentTime(now()), - outstandingReplies(0), pingLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SAMPLE_AMOUNT : 1), - lastLoggedTime(0.0), lastLoggedBytesReceived(0), lastLoggedBytesSent(0), timeoutCount(0), + bytesReceived(0), bytesSent(0), lastDataPacketSentTime(now()), outstandingReplies(0), + pingLatencies(destination.isPublic() ? FLOW_KNOBS->PING_SAMPLE_AMOUNT : 1), lastLoggedTime(0.0), + lastLoggedBytesReceived(0), lastLoggedBytesSent(0), timeoutCount(0), protocolVersion(Reference>>(new AsyncVar>())), connectOutgoingCount(0), connectIncomingCount(0), connectFailedCount(0), connectLatencies(destination.isPublic() ? FLOW_KNOBS->NETWORK_CONNECT_SAMPLE_AMOUNT : 1) { @@ -1261,7 +1261,6 @@ ACTOR static Future connectionReader(TransportData* transport, state bool expectConnectPacket = true; state bool compatible = false; state bool incompatiblePeerCounted = false; - state bool incompatibleProtocolVersionNewer = false; state NetworkAddress peerAddress; state ProtocolVersion peerProtocolVersion; state Reference authorizedTenants = makeReference(); @@ -1327,7 +1326,6 @@ ACTOR static Future connectionReader(TransportData* transport, uint64_t connectionId = pkt.connectionId; if (!pkt.protocolVersion.hasObjectSerializerFlag() || !pkt.protocolVersion.isCompatible(g_network->protocolVersion())) { - incompatibleProtocolVersionNewer = pkt.protocolVersion > g_network->protocolVersion(); NetworkAddress addr = pkt.canonicalRemotePort ? NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort) : conn->getPeerAddress(); @@ -1387,7 +1385,6 @@ ACTOR static Future connectionReader(TransportData* transport, .suppressFor(1.0) .detail("PeerAddr", NetworkAddress(pkt.canonicalRemoteIp(), pkt.canonicalRemotePort)); peer->compatible = compatible; - peer->incompatibleProtocolVersionNewer = incompatibleProtocolVersionNewer; if (!compatible) { peer->transport->numIncompatibleConnections++; incompatiblePeerCounted = true; @@ -1405,7 +1402,6 @@ ACTOR static Future connectionReader(TransportData* transport, } peer = transport->getOrOpenPeer(peerAddress, false); peer->compatible = compatible; - peer->incompatibleProtocolVersionNewer = incompatibleProtocolVersionNewer; if (!compatible) { peer->transport->numIncompatibleConnections++; incompatiblePeerCounted = true; @@ -1745,8 +1741,7 @@ static ReliablePacket* sendPacket(TransportData* self, // If there isn't an open connection, a public address, or the peer isn't compatible, we can't send if (!peer || (peer->outgoingConnectionIdle && !destination.getPrimaryAddress().isPublic()) || - (peer->incompatibleProtocolVersionNewer && - destination.token != Endpoint::wellKnownToken(WLTOKEN_PING_PACKET))) { + (!peer->compatible && destination.token != Endpoint::wellKnownToken(WLTOKEN_PING_PACKET))) { TEST(true); // Can't send to private address without a compatible open connection return nullptr; } diff --git a/fdbrpc/FlowTransport.h b/fdbrpc/FlowTransport.h index ceaf3e6f35..b19f3adb88 100644 --- a/fdbrpc/FlowTransport.h +++ b/fdbrpc/FlowTransport.h @@ -159,7 +159,6 @@ struct Peer : public ReferenceCounted { double lastConnectTime; double reconnectionDelay; int peerReferences; - bool incompatibleProtocolVersionNewer; int64_t bytesReceived; int64_t bytesSent; double lastDataPacketSentTime;