Central Lock not shared across the cluster

Neeraj
2012-10-30
2012-10-31
  • Neeraj
    Neeraj
    2012-10-30

    Hello,

    I am using CENTRAL_LOCK for cluster-wide locking feature using LockService. The logs showing the central_lock view is only limited to local node and not across!!! Please find the log snapshot of node1 below.

    testApp.log:30.10.2012 15.37.20:194 278 INFO {main}JGROUPS_ClassConfigurator Using jg-magic-map.xml as magic number file and jg-protocol-ids.xml for protocol IDs
    testApp.log:30.10.2012 15.37.20:559 279 INFO {main}JGROUPS_FRAG2 received CONFIG event: {bind_addr=/10.10.24.32}
    testApp.log:30.10.2012 15.37.20:569 280 INFO {main}JGROUPS_FRAG2 received CONFIG event: {additional_data=[B@f3f348b}
    testApp.log:30.10.2012 15.37.23:598 281 INFO {main}JGROUPS_NAKACK
    testApp.log:30.10.2012 15.37.23:598 282 INFO {main}JGROUPS_GMS 10.10.24.32-testApp(testApp): view is [10.10.24.32-testApp(testApp)|0]
    [10.10.24.32-testApp(testApp)]
    testApp.log:30.10.2012 15.37.23:599 283 INFO {main}JGROUPS_STABLE resuming message garbage collection
    testApp.log:30.10.2012 15.37.23:600 284 INFO {main}JGROUPS_FD_SOCK VIEW_CHANGE received: [10.10.24.32-testApp(testApp)]
    testApp.log:30.10.2012 15.37.23:603 285 INFO {main}JGROUPS_STABLE [ergonomics] setting max_bytes to 4MB (1 members)
    testApp.log:30.10.2012 15.37.23:604 286 INFO {main}JGROUPS_CENTRAL_LOCK view=[10.10.24.32-testApp(testApp)|0] [10.10.24.32-testApp(testApp)]
    testApp.log:30.10.2012 15.37.23:604 287 INFO {main}JGROUPS_CENTRAL_LOCK local_addr=10.10.24.32-testApp(testApp), coord=10.10.24.32-testApp(testApp), is_coord=true
    testApp.log:30.10.2012 15.38.31:682 290 INFO {main}JGROUPS_STABLE resuming message garbage collection
    testApp.log:30.10.2012 15.38.31:682 291 INFO {main}JGROUPS_GMS created group (first member). My view is [10.10.23.85-testApp(testApp)|0], impl is org.jgroups.protocols.pbcast.CoordGmsImpl
    testApp.log:30.10.2012 15.38.31:682 292 INFO {main}JGROUPSMANAGER Channel was connected.

    there is similar log for node2 also.

    There are two node in the cluster (namely 10.10.24.32 and 10.10.23.85). The below is the TCP stack I am using. The code takes bind_addr from /etc/hosts file for tags VERIFY_SUSPECT, FD_SOCK and STATE_SOCK.

    <tcpconfig>
    <config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:jgroups &lt;a href=" http:="" www.jgroups.org="" schema="" JGroups-3.0.xsd"="">http://www.jgroups.org/schema/JGroups-3.0.xsd">
    <TCP bind_port="7800"
    loopback="false"
    recv_buf_size="20M"
    send_buf_size="640K"
    discard_incompatible_packets="true"
    max_bundle_size="64K"
    max_bundle_timeout="30"
    enable_bundling="true"
    enable_diagnostics="false"
    use_send_queues="true"
    sock_conn_timeout="300"

             timer_type="new"
             timer.min_threads="4"
             timer.max_threads="10"
             timer.keep_alive_time="3000"
             timer.queue_max_size="500"
    
             thread_pool.enabled="true"
             thread_pool.min_threads="1"
             thread_pool.max_threads="10"
             thread_pool.keep_alive_time="5000"
             thread_pool.queue_enabled="false"
             thread_pool.queue_max_size="100"
             thread_pool.rejection_policy="discard"
    
             oob_thread_pool.enabled="true"
             oob_thread_pool.min_threads="1"
             oob_thread_pool.max_threads="8"
             oob_thread_pool.keep_alive_time="5000"
             oob_thread_pool.queue_enabled="false"
             oob_thread_pool.queue_max_size="100"
             oob_thread_pool.rejection_policy="discard"/>
    
        <TCPPING timeout="3000"
                 initial_hosts="10.10.24.32[7800],10.10.23.85[7800]" 
                 port_range="3"
                 num_initial_members="3"/>
        <MERGE2  min_interval="10000"
                 max_interval="30000"/>
        <FD_SOCK start_port="7830"/>
        <FD timeout="3000" max_tries="3" />
        <VERIFY_SUSPECT timeout="1500"  />
        <BARRIER />
        <pbcast.NAKACK
                       use_mcast_xmit="false" 
                       retransmit_timeout="300,600,1200,2400,4800"
                       discard_delivered_msgs="true"/>
        <UNICAST timeout="300,600,1200" />
        <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                       max_bytes="4M"/>
        <pbcast.GMS print_local_addr="true" join_timeout="3000"
    
                    view_bundling="true"/>
        <UFC max_credits="2M"
             min_threshold="0.4"/>
        <MFC max_credits="2M"
             min_threshold="0.4"/>
        <FRAG2 frag_size="60K"  />
         <!-- <pbcast.STREAMING_STATE_TRANSFER/> 
         <pbcast.STATE_TRANSFER/> -->
         <pbcast.STATE_SOCK/>
         <CENTRAL_LOCK num_backups="5"/>    
    </config>
    

    </tcpconfig>

    Please let me know, how can I get the CENTRAL_LOCK supported across the cluster. Also, correct if I am missing something here.

     
    • Bela Ban
      Bela Ban
      2012-10-30

      You'll need to set bind_addr in TCP to 10.10.24.32 or 10.10.23.85,
      respectively. Also, make sure no firewall is discarding packets

      On 10/30/12 11:25 AM, Neeraj wrote:

      Hello,

      I am using CENTRAL_LOCK for cluster-wide locking feature using LockService. The logs showing the central_lock view is only limited to local node and not across!!! Please find the log snapshot of node1 below.

      testApp.log:30.10.2012 15.37.20:194 278 INFO {main}JGROUPS_ClassConfigurator Using jg-magic-map.xml as magic number file and jg-protocol-ids.xml for protocol IDs
      testApp.log:30.10.2012 15.37.20:559 279 INFO {main}JGROUPS_FRAG2 received CONFIG event: {bind_addr=/10.10.24.32}
      testApp.log:30.10.2012 15.37.20:569 280 INFO {main}JGROUPS_FRAG2 received CONFIG event: {additional_data=[B@f3f348b}
      testApp.log:30.10.2012 15.37.23:598 281 INFO {main}JGROUPS_NAKACK
      testApp.log:30.10.2012 15.37.23:598 282 INFO {main}JGROUPS_GMS 10.10.24.32-testApp(testApp): view is [10.10.24.32-testApp(testApp)|0]
      [10.10.24.32-testApp(testApp)]
      testApp.log:30.10.2012 15.37.23:599 283 INFO {main}JGROUPS_STABLE resuming message garbage collection
      testApp.log:30.10.2012 15.37.23:600 284 INFO {main}JGROUPS_FD_SOCK VIEW_CHANGE received: [10.10.24.32-testApp(testApp)]
      testApp.log:30.10.2012 15.37.23:603 285 INFO {main}JGROUPS_STABLE [ergonomics] setting max_bytes to 4MB (1 members)
      testApp.log:30.10.2012 15.37.23:604 286 INFO {main}JGROUPS_CENTRAL_LOCK view=[10.10.24.32-testApp(testApp)|0] [10.10.24.32-testApp(testApp)]
      testApp.log:30.10.2012 15.37.23:604 287 INFO {main}JGROUPS_CENTRAL_LOCK local_addr=10.10.24.32-testApp(testApp), coord=10.10.24.32-testApp(testApp), is_coord=true
      testApp.log:30.10.2012 15.38.31:682 290 INFO {main}JGROUPS_STABLE resuming message garbage collection
      testApp.log:30.10.2012 15.38.31:682 291 INFO {main}JGROUPS_GMS created group (first member). My view is [10.10.23.85-testApp(testApp)|0], impl is org.jgroups.protocols.pbcast.CoordGmsImpl
      testApp.log:30.10.2012 15.38.31:682 292 INFO {main}JGROUPSMANAGER Channel was connected.

      there is similar log for node2 also.

      There are two node in the cluster (namely 10.10.24.32 and 10.10.23.85). The below is the TCP stack I am using. The code takes bind_addr from /etc/hosts file for tags VERIFY_SUSPECT, FD_SOCK and STATE_SOCK.

      <tcpconfig>
      <config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:jgroups &lt;a href=" http:="" www.jgroups.org="" schema="" JGroups-3.0.xsd"="">http://www.jgroups.org/schema/JGroups-3.0.xsd">
      <TCP bind_port="7800"
      loopback="false"
      recv_buf_size="20M"
      send_buf_size="640K"
      discard_incompatible_packets="true"
      max_bundle_size="64K"
      max_bundle_timeout="30"
      enable_bundling="true"
      enable_diagnostics="false"
      use_send_queues="true"
      sock_conn_timeout="300"

                timer_type="new"
                timer.min_threads="4"
                timer.max_threads="10"
                timer.keep_alive_time="3000"
                timer.queue_max_size="500"
      
                thread_pool.enabled="true"
                thread_pool.min_threads="1"
                thread_pool.max_threads="10"
                thread_pool.keep_alive_time="5000"
                thread_pool.queue_enabled="false"
                thread_pool.queue_max_size="100"
                thread_pool.rejection_policy="discard"
      
                oob_thread_pool.enabled="true"
                oob_thread_pool.min_threads="1"
                oob_thread_pool.max_threads="8"
                oob_thread_pool.keep_alive_time="5000"
                oob_thread_pool.queue_enabled="false"
                oob_thread_pool.queue_max_size="100"
                oob_thread_pool.rejection_policy="discard"/>
      
           <TCPPING timeout="3000"
                    initial_hosts="10.10.24.32[7800],10.10.23.85[7800]"
                    port_range="3"
                    num_initial_members="3"/>
           <MERGE2  min_interval="10000"
                    max_interval="30000"/>
           <FD_SOCK start_port="7830"/>
           <FD timeout="3000" max_tries="3" />
           <VERIFY_SUSPECT timeout="1500"  />
           <BARRIER />
           <pbcast.NAKACK
                       use_mcast_xmit="false"
                          retransmit_timeout="300,600,1200,2400,4800"
                          discard_delivered_msgs="true"/>
           <UNICAST timeout="300,600,1200" />
           <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                          max_bytes="4M"/>
           <pbcast.GMS print_local_addr="true" join_timeout="3000"
      
                       view_bundling="true"/>
           <UFC max_credits="2M"
                min_threshold="0.4"/>
           <MFC max_credits="2M"
                min_threshold="0.4"/>
           <FRAG2 frag_size="60K"  />
            <!--<pbcast.STREAMING_STATE_TRANSFER/>
            <pbcast.STATE_TRANSFER/>  -->
            <pbcast.STATE_SOCK/>
            <CENTRAL_LOCK num_backups="5"/>
       </config>
      

      </tcpconfig>

      Please let me know, how can I get the CENTRAL_LOCK supported across the cluster. Also, correct if I am missing something here.


      Sent from sourceforge.net because you indicated interest inhttps://sourceforge.net/p/javagroups/discussion/130427/

      To unsubscribe from further messages, please visithttps://sourceforge.net/auth/prefs/

      --
      Bela Ban, JGroups lead (http://www.jgroups.org)

       
  • Neeraj
    Neeraj
    2012-10-31

    Hello Bela,

    The firewall is not discarding any packets and even after providing the bind_addr to TCP the locking is still faulty. One more thing to tell is that I am using AddressGenerate Class to use the PayloadUUID address class in my code. Does the problem has to do something with it?

    Anything else i need to check? Please let me know!!

    Regards,
    Neeraj

     
  • Bela Ban
    Bela Ban
    2012-10-31

    I suggest run 2 instances without CENTRAL_LOCK on the stack, and see if they form a cluster. Using an AddressGenerator should be fine, but if the above step doesn't work, remove the AddressGenerator code and see if this fixes the problem.

     
  • Neeraj
    Neeraj
    2012-10-31

    The cluster is formed when both CENTRAL_LOCK and AddressGenerator were removed.

    The reason I had used the AddressGenerator was to make sure I can maintain the old code for IpAddress.getAdditionalData() (deprecated in 3.x Jgroups) via PayloadUUID.

    Can you suggest me some way/class I can use to maintain the behaviour of IpAddress.getAdditionalData() in my code!! Or if I have to use AddressGenerate class, how can I use it???

     
  • Bela Ban
    Bela Ban
    2012-10-31

    How do you use the AddressGenerator ?

    CENTRAL_LOCK does work with an AddressGenerator: you can use LockServiceDemo to test this:
    In start(), after the channel is created, add the following code:

    ch.setAddressGenerator(new AddressGenerator() {
       public Address generateAddress() {
           return PayloadUUID.randomUUID(name", "yourpayload");
       }
    });
    

    This will use addresses that are PayloadUUIDs, and I verified that this works.

    If your code still doesn't work, why don't you send me a small standalone program which reproduces the issue and I'll have a look ?

     
  • Neeraj
    Neeraj
    2012-10-31

    I had wrongly code for AddressGenerator.

    Thanks for the sample code. Problem seems to be solved now. :)