• Daniele Sciascia's avatar
    MDEV-13549 Fix and re-enable test galera.galera_suspend_slave · 832025b5
    Daniele Sciascia authored
    Test galera_suspend_slave checks that after suspending a galera
    node, like this:
    ```
    --perl
            my $pid_filename = $ENV{'NODE_2_PIDFILE'};
            my $mysqld_pid = `cat $pid_filename`;
            chomp($mysqld_pid);
            system("kill -SIGSTOP $mysqld_pid");
            exit(0);
    EOF
    ```
    
    the remaining one node cluster is no longer able to successfully
    INSERT new rows:
    ```
    --error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT,ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
    INSERT INTO t1 VALUES (1);
    ```
    
    On rare occasions when the system is overloaded, it appears that
    suspending the process with ```system("kill -SIGSTOP $mysqld_pid")```
    takes some time, enough for the subsequent INSERT to succeed. In which
    case the test fails because it rightly expects the INSERT to fail.
    
    To fix the problem, the patch makes sure that the cluster has shrinked
    to one node, before trying to INSERT the new value.
    832025b5
disabled.def 2.69 KB