Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11959

SET GLOBAL wsrep_provider_options='pc.weight=<n>' not set properly, always one behind. Needs to be set twice.

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.1.21, 5.5.54-galera, 10.0.29-galera, 10.3.5
    • N/A
    • Galera

    Description

      Upstream: https://github.com/codership/galera/issues/446

      On multiple MariaDB Server versions (5.5.x & 10.0.x).
      If I try to set SET GLOBAL wsrep_provider_options='pc.weight=' on a cluster with more than one running node the value is not picked up immediately, it looks like it is always one behind.

      SHOW GLOBAL VARIABLES like 'wsrep_provider%';
      ....pc.weight = 1; ....

      SET GLOBAL wsrep_provider_options='pc.weight=5';
      SHOW GLOBAL VARIABLES like 'wsrep_provider%';
      ....pc.weight = 1; ....

      SET GLOBAL wsrep_provider_options='pc.weight=9';
      SHOW GLOBAL VARIABLES like 'wsrep_provider%';
      ....pc.weight = 5; ....

      SET GLOBAL wsrep_provider_options='pc.weight=22';
      SHOW GLOBAL VARIABLES like 'wsrep_provider%';
      ....pc.weight = 9; ....

      So basically to set the parameter I have to set it twice to the same value:

      SET GLOBAL wsrep_provider_options='pc.weight=45';
      SET GLOBAL wsrep_provider_options='pc.weight=45';
      SHOW GLOBAL VARIABLES like 'wsrep_provider%';
      ....pc.weight = 45; ....

      Please note: This does not happen if only one Galera node is running.

      Attachments

        Activity

          claudio.nanni Claudio Nanni added a comment -

          It looks it's a know issue:
          =====
          Note You can change node weight in runtime by setting the pc.weight parameter.

          SET GLOBAL wsrep_provider_options="pc.weight=3";

          Galera Cluster applies the new weight on the delivery of a message that carries a weight. At the moment, there is no mechanism to notify the application of a new weight, but will eventually happen when the message is delivered.
          =====
          http://galeracluster.com/documentation-webpages/weightedquorum.html

          Not sure what that means:

          • Can't even see it in the session I've set it
          • SET GLOBAL command becomes a "message that carries a weight", only the second time?
          claudio.nanni Claudio Nanni added a comment - It looks it's a know issue: ===== Note You can change node weight in runtime by setting the pc.weight parameter. SET GLOBAL wsrep_provider_options="pc.weight=3"; Galera Cluster applies the new weight on the delivery of a message that carries a weight. At the moment, there is no mechanism to notify the application of a new weight, but will eventually happen when the message is delivered. ===== http://galeracluster.com/documentation-webpages/weightedquorum.html Not sure what that means: Can't even see it in the session I've set it SET GLOBAL command becomes a "message that carries a weight", only the second time?

          To be clear, the "second" SET GLOBAL command only makes it so you now see the "first" SET GLOBAL. If you start mix-matching values for pc.weight, you will see this. So in effect, the "second" SET GLOBAL carries weight in that you can now see what was set in the "first" SET GLOBAL, but you are still not seeing what was set via the "second" SET GLOBAL. It just looks like it does if you use the same value for pc.weight.

          We should just force this to take effect when it is set the first time. This is very confusing.

          ccalender Chris Calender (Inactive) added a comment - To be clear, the "second" SET GLOBAL command only makes it so you now see the "first" SET GLOBAL. If you start mix-matching values for pc.weight, you will see this. So in effect, the "second" SET GLOBAL carries weight in that you can now see what was set in the "first" SET GLOBAL, but you are still not seeing what was set via the "second" SET GLOBAL. It just looks like it does if you use the same value for pc.weight. We should just force this to take effect when it is set the first time. This is very confusing.

          set some other dynamic wsrep_provider_options

          [root@t4w6 ~]# mysql -u root -p1 -e "SET GLOBAL wsrep_provider_options='pc.weight=1';"
           
           
          [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]"
          pc.weight = 9
           
          [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]"
          pc.weight = 9
           
           
          [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep  pc.ignore_quorum
          wsrep_provider_options  base_dir = /var/lib/mysql/; base_host = 192.168.104.196; base_port = 4567; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; gcache.dir = /var/lib/mysql/; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /var/lib/mysql//galera.cache; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.listen_addr = tcp://0.0.0.0:4567; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ist.recv_addr = 192.168.104.196; pc.announce_timeout = PT3S; pc.bootstrap = YES; pc.checksum = false; pc.ignore_quorum = FALSE; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 9; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 8; socket.checksum = 2; socket.recv_buf_size = 212992;
          [root@t4w6 ~]#  mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]"
          pc.weight = 9
          [root@t4w6 ~]# mysql -u root -p1 -e "SET GLOBAL wsrep_provider_options='pc.ignore_quorum=FALSE';"
          [root@t4w6 ~]#  mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]"
          pc.weight = 1
          
          

          after setting some other dynamic wsrep_provider_options
          for example pc.ignore_quorum=FALSE , nevertheless pc.ignore_quorum is already FALSE
          the new pc.weight value takes effect :

          [root@t4w6 ~]#  mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]"
          pc.weight = 9
          [root@t4w6 ~]# mysql -u root -p1 -e "SET GLOBAL wsrep_provider_options='pc.ignore_quorum=FALSE';"
          [root@t4w6 ~]#  mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]"
          pc.weight = 1
          

          winstone Zdravelina Sokolovska (Inactive) added a comment - set some other dynamic wsrep_provider_options [root@t4w6 ~]# mysql -u root -p1 -e "SET GLOBAL wsrep_provider_options='pc.weight=1';"     [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]" pc.weight = 9   [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]" pc.weight = 9     [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep pc.ignore_quorum wsrep_provider_options base_dir = /var/lib/mysql/; base_host = 192.168.104.196; base_port = 4567; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; gcache.dir = /var/lib/mysql/; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /var/lib/mysql//galera.cache; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.listen_addr = tcp://0.0.0.0:4567; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ist.recv_addr = 192.168.104.196; pc.announce_timeout = PT3S; pc.bootstrap = YES; pc.checksum = false; pc.ignore_quorum = FALSE; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 9; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 8; socket.checksum = 2; socket.recv_buf_size = 212992; [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]" pc.weight = 9 [root@t4w6 ~]# mysql -u root -p1 -e "SET GLOBAL wsrep_provider_options='pc.ignore_quorum=FALSE';" [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]" pc.weight = 1 after setting some other dynamic wsrep_provider_options for example pc.ignore_quorum=FALSE , nevertheless pc.ignore_quorum is already FALSE the new pc.weight value takes effect : [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]" pc.weight = 9 [root@t4w6 ~]# mysql -u root -p1 -e "SET GLOBAL wsrep_provider_options='pc.ignore_quorum=FALSE';" [root@t4w6 ~]# mysql -u root -p1 -e "show variables like 'wsrep_provider_options'" | grep -o "pc.weight = [0-9]" pc.weight = 1
          teemu.ollakka Teemu Ollakka added a comment -

          This issue has been fixed in Galera: https://github.com/codership/galera/issues/505 and the fix has been merged into MariaDB/Galera tree. This bug could be closed.

          teemu.ollakka Teemu Ollakka added a comment - This issue has been fixed in Galera: https://github.com/codership/galera/issues/505 and the fix has been merged into MariaDB/Galera tree. This bug could be closed.

          People

            seppo Seppo Jaakola
            claudio.nanni Claudio Nanni
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.