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

wsrep_dirty_reads not possible with wsrep_sync_wait (deadlock)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.17-galera
    • Fix Version/s: None
    • Component/s: Galera
    • Labels:
      None

      Description

      1. Three node galera cluster, with wsrep_sync_wait=1 in /etc/my.cnf
      2. Kill two of three nodes
      3. Connect to last node, try to enable dirty reads and select data from it. You get a lock wait timeout exception (1205). SET wsrep_sync_wait=0 gets you halfway but you still cannot access table data.

      Server version: 10.0.17-MariaDB-wsrep-log
      
      Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      MariaDB [(none)]> select 1;
      ERROR 1047 (08S01): WSREP has not yet prepared node for application use
      MariaDB [(none)]> set wsrep_dirty_reads=1;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> select 1;
      ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
      MariaDB [(none)]> set wsrep_sync_wait=0;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> select 1;
      +---+
      | 1 |
      +---+
      | 1 |
      +---+
      1 row in set (0.00 sec)
      
      MariaDB [(none)]> use mysql;
      ERROR 1047 (08S01): WSREP has not yet prepared node for application use
      MariaDB [(none)]> select @@global.wsrep_sync_wait;
      +--------------------------+
      | @@global.wsrep_sync_wait |
      +--------------------------+
      |                        1 |
      +--------------------------+
      1 row in set (0.00 sec)
      
      MariaDB [(none)]> set @@global.wsrep_sync_wait=0;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> use mysql;
      ERROR 1047 (08S01): WSREP has not yet prepared node for application use
      
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            rrva Ragnar Rova added a comment -

            seems like if I only want to do selects, I can instead of wsrep_dirty_reads session-level variable wsrep_on?

            like so:

            -> select foo ...
            <- ERROR 1047 (08S01): WSREP has not yet prepared node for application use
            -> set wsrep_on=OFF; select foo...
            <- ...
            -> set wsrep_on=ON;

            ?

            Show
            rrva Ragnar Rova added a comment - seems like if I only want to do selects, I can instead of wsrep_dirty_reads session-level variable wsrep_on? like so: -> select foo ... <- ERROR 1047 (08S01): WSREP has not yet prepared node for application use -> set wsrep_on=OFF; select foo... <- ... -> set wsrep_on=ON; ?
            Hide
            rrva Ragnar Rova added a comment -

            Sorry, I think this is not a bug. If I remove 'use mysql' and instead do select * from mysql.user all works fine.

            Show
            rrva Ragnar Rova added a comment - Sorry, I think this is not a bug. If I remove 'use mysql' and instead do select * from mysql.user all works fine.
            Hide
            rrva Ragnar Rova added a comment -

            @elenst: You may close this, I do not need to be able to use 'use' statements in this mode. Not a bug.

            Show
            rrva Ragnar Rova added a comment - @elenst: You may close this, I do not need to be able to use 'use' statements in this mode. Not a bug.

              People

              • Assignee:
                nirbhay_c Nirbhay Choubey
                Reporter:
                rrva Ragnar Rova
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: