Bug #94515 With MINIMAL upgrade GR plugin blocks connection to the server
Submitted: 28 Feb 2019 19:09 Modified: 1 Apr 2019 14:01
Reporter: Narendra Singh Chauhan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[28 Feb 2019 19:09] Narendra Singh Chauhan
Description:
Scenario: Start server on 8.0.17 with group_replication plugin loaded, on default data directory of 5.7.
Tested with: --upgrade=auto/minimal/force

Observation:- 
1. When server is upgraded with --upgrade=auto/force, we are able to connect to server through client. << This is OK.
2. When server is upgraded with --upgrade=minimal, we are NOT able to connect to server through client. << This is NOK.

Concern:- Why server gets hanged i.e. client doesn't able to connect to the server? If there are any issues those must be
reported in error log.

How to repeat:
Details:-
=========
Tested with MySQL Versions:
5.7.27
8.0.17

Steps to repro:-
================
## In 5.7
$ mkdir -p mysql-test/var/mysqld.1/data mysql-test/var/log \
 mysql-test/var/tmp/mysqld.1;

$ ./bin/mysqld --no-defaults --datadir=$PWD/mysql-test/var/mysqld.1/data \
 --basedir=$PWD --log-error=$PWD/mysql-test/var/log/mysqld.1.err \
 --initialize-insecure --core-file 2>&1 &

$ ./bin/mysqld --no-defaults --basedir=$PWD --port=13000 \
 --datadir=$PWD/mysql-test/var/mysqld.1/data --socket=/tmp/mysqld.1.sock \
 --report-host=localhost --log-error=$PWD/mysql-test/var/log/mysqld.1.err \
 --server-id=1 --core-file 2>&1 &

$ ./bin/mysql -uroot -S/tmp/mysqld.1.sock \
  -e "set global innodb_fast_shutdown=0; shutdown;";

## Save Data Directory path of 5.7
$ DD57PATH="$PWD/mysql-test/var/mysqld.1/data"

## In 8.0:
$ mkdir -p mysql-test/var/mysqld.4/data mysql-test/var/log \
 mysql-test/var/tmp/mysqld.4;

$ ./bin/mysqld --no-defaults --port=13000 --server-id=1 --basedir="$PWD" \
 --report-host="localhost" --socket="/tmp/mysqldtrunk.4.sock" \
 --datadir="$DD57PATH" \
 --log-error="$PWD/mysql-test/var/log/mysqld.4.err" \
 --general_log_file="$PWD/mysql-test/var/mysqld.4/mysqld.log" \
 --binlog-checksum="NONE" --enforce-gtid-consistency --gtid-mode=ON \
 --transaction-write-set-extraction="XXHASH64" \
 --plugin-dir="$PWD/../plugin_output_directory/" \
 --plugin-load="group_replication.so" \
 --group_replication_group_name="baaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" \
 --upgrade=MINIMAL \
 --core-file 2>&1 &

$ ./mysql -uroot -S/tmp/mysqldtrunk.4.sock  << Observe that it hangs.

Suggested fix:
Workaround: --upgrade=auto/force OR no --upgrade option.
[1 Apr 2019 14:01] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.17:

Group Replication cannot be started following a MySQL Server upgrade that uses the MINIMAL option
(--upgrade=MINIMAL), which does not upgrade system tables on which the replication internals
depend. Previously, in this situation, the server was waiting indefinitely for Group Replication to start. 
The situation is now handled correctly by unblocking the waiting thread and issuing the expected error
ER_GRP_RPL_START_GRP_RPL_FAILED.