There's currently a check in `TransportService.HandshakeResponse.isIncompatibleBuild` to stop ES with the same Version but different build hashes from joining a cluster. This needs to be relaxed for cloud deployments where Version is not applicable
server/src/test/java/org/elasticsearch/transport/TransportServiceHandshakeTests.java
);
        try (
            Transport.Connection connection = AbstractSimpleTransportTestCase.openConnection(
                transportServiceA,
                discoveryNode,
                TestProfiles.LIGHT_PROFILE
            )
        ) {
            DiscoveryNode connectedNode = PlainActionFuture.get(fut -> transportServiceA.handshake(connection, timeout, fut));
            assertNotNull(connectedNode);
            
            assertEquals(connectedNode.getName(), "TS_B");
            assertEquals(connectedNode.getVersion(), transportServiceB.getLocalNode().getVersion());
            assertFalse(transportServiceA.nodeConnected(discoveryNode));
        }
    }
    public void testMismatchedClusterName() {
        TransportService transportServiceA = startServices(
            "TS_A",
            Settings.builder().put("cluster.name", "a").build(),
            TransportVersion.CURRENT,
            Version.CURRENT,
            TransportService.NOOP_TRANSPORT_INTERCEPTOR
        );
        TransportService transportServiceB = startServices(
            "TS_B",
            Settings.builder().put("cluster.name", "b").build(),
            TransportVersion.CURRENT,
            Version.CURRENT,
            TransportService.NOOP_TRANSPORT_INTERCEPTOR