3 Replies Latest reply on Aug 9, 2010 4:22 AM by Jeff Mesnil

    forming a one-way cluster of 2 nodes

    Jeff Mesnil Master

      Let's consider the simple case of a one-way cluster of 2 nodes.

      node #0 has a cluster connection "cluster" to connect to node #1 with a static connector
      node #1 has no cluster connection, defines no connector and just an acceptor
      (this is the setup used in OnewayTwoNodeClusterTest)
      node #1 is started
        - its cluster manager is started
          - it does nothing as the node does not define a cluster connection
      node #0 is started
        - its cluster manager is started
          - its cluster connection connect successfully to node #1 and subscribes to its topology
      node #1 receives the topology subscription message but it does not have anything to announce as it has no cluster connection
      node #0 will *not* be notified that node #1 is UP (even though it is connected to it...)
      => the cluster will not be formed
      How is this supposed to work?
      node #1 should notify node #0 that it is UP and send its node ID. However which connector pairs is it supposed to use?
      Node #0 knows the connector to connect to node #1 but not its node ID.
      AIUI, a node which participates in a cluster should announce itself to other nodes whether it has its own cluster connections or not.
      What I don't get is which pair of connector is it supposed to use in the case it has no cluster connection.
      Should we mandate for HA nodes to define a connector to be used for those cases? Which one do we chose if the node define multiple connectors?
        • 1. Re: forming a one-way cluster of 2 nodes
          Tim Fox Master

          When a node announces itself it does not use a pair of connectors, it uses a single connector. This is the connector given by the "connector" attribute in ClusterConnectionImpl and defined in the xml by the connector-ref element in the cluster-connection element.

           

          For a one way cluster, both nodes should define a cluster connection so that presence is announced, but we can add a new boolean attribute "create-connections" or "one-way" or something that determines whether actual connections are made or if just the presence is announced.

          • 2. Re: forming a one-way cluster of 2 nodes
            Jeff Mesnil Master

            Let's consider the case of chained one-way cluster.

             

            node #0            node #1            node #2
                    cluster0-1         cluster1-2        cluster2-X
                    --------->         --------->        ---------X
            

             

            • node #0 defines a cluster connection cluster0-1 with a connector to node #1
            • node #1 defines a cluster connection cluster1-2 with a connector to node #2
            • node #2 defines a cluster connection cluster2-X (with no connector) so that it can announce its presence to node #1

             

            With the new code, when node #2 announce its presence to node #1, node #1 will in turn propagate the node presence to its own cluster connections connected to it (e.g. node #0 through cluster 0-1).

            This ends up with node #0 being notified that node #2 is up and create a cluster connection to it which should not happen.

             

            What I don't get is how the new HA code is supposed to behave in that case.

            We want to notify the node only inside the same "cluster" (as defined by the cluster connection) and not on all clusters the node belongs to.

            Currently the code go through the ClusterManager and "forgets" the cluster was is receiving the node announcement.

            I suppose that a node can still belong to different cluster (e.g. node #1 is the target of cluster0-1 and the destination of cluster1-2).

             

            In that case, the notifications of node announcement should be handled inside the cluster connection and not delegate to the cluster manager. Is that correct?