eclipse-vertx / vert.x

Vert.x is a tool-kit for building reactive applications on the JVM
http://vertx.io
Other
14.32k stars 2.08k forks source link

HAManager couldn't see quorum if during its initialization cluster manager has all nodes joined already #5272 #5273

Closed apanasevich closed 3 months ago

apanasevich commented 3 months ago

Fixes #5272

The key idea is to wait until clusterMap get information from other nodes like it done in nodeAdded method.

vietj commented 3 months ago

@apanasevich can you provide a reproducer for this or add a test demonstrating where this is useful ?

apanasevich commented 3 months ago

Hi @vietj

I cannot reproduce a bug. The problem occures when clusterManager.getNodes(); contains a node, but clusterMap.get(node); do not yet. And this case is covered with timered check in method checkQuorumWhenAdded, but not covered on init.

      List<String> nodes = clusterManager.getNodes();
      int count = 0;
      for (String node : nodes) {
        String json = clusterMap.get(node);

I'll try to write a test covering the issue.

apanasevich commented 3 months ago

I've written the test with a special ClusterManager emulating the issue behaviour. It does not call nodeAdded listerens that looks like cluster was created before Vert.x initiates HAManager.

Please take a look at the PR again.

vietj commented 3 months ago

thanks @apanasevich

apanasevich commented 3 months ago

NetTest.testSocketAddress timed out. But this test does not use HA feature and even does not deploy a verticle.

vietj commented 3 months ago

@apanasevich there are some flaky tests, I reran the CI