text: ################################################################################
  # This test is to test if group replication can be started with needed variables
  # persisted into mysqld-auto.cnf file.
  # Test:
  # 1. Persist configuration on server1.
  # 2. Restart server1, it must bootstrap the group.
  # 3. Persist configuration on server2.
  # 4. Restart server2, it must join the group.
  # 5. Clean up.
  ################################################################################
  --source include/big_test.inc
  --source include/have_group_replication_plugin.inc
  --let $rpl_skip_group_replication_start= 1
  --source include/group_replication.inc
  
  
  --echo
  --echo ############################################################
  --echo # 1. Persist configuration on server1.
  --let $rpl_connection_name= server1
  --source include/rpl_connection.inc
  --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
  --eval SET PERSIST group_replication_group_name= "$group_replication_group_name"
  --eval SET PERSIST group_replication_group_seeds= @@GLOBAL.group_replication_group_seeds
  --eval SET PERSIST group_replication_local_address= @@GLOBAL.group_replication_local_address
  SET PERSIST group_replication_start_on_boot= ON;
  SET PERSIST group_replication_bootstrap_group= ON;
  SET PERSIST group_replication_recovery_get_public_key= ON;
  
  
  --echo
  --echo ############################################################
  --echo # 2. Restart server1, it must bootstrap the group.
  --let $allow_rpl_inited= 1
  --source include/restart_mysqld.inc
  --let $rpl_server_number= 1
  --source include/rpl_reconnect.inc
  
  --let $group_replication_member_state= ONLINE
  --source include/gr_wait_for_member_state.inc
  
  SELECT variable_name, variable_source FROM performance_schema.variables_info WHERE variable_source IN ('PERSISTED');
  
  
  --echo
  --echo ############################################################
  --echo # 3. Persist configuration on server2.
  --let $rpl_connection_name= server2
  --source include/rpl_connection.inc
  --replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
  --eval SET PERSIST group_replication_group_name= "$group_replication_group_name"
  --eval SET PERSIST group_replication_group_seeds= @@GLOBAL.group_replication_group_seeds
  --eval SET PERSIST group_replication_local_address= @@GLOBAL.group_replication_local_address
  SET PERSIST group_replication_start_on_boot= ON;
  SET PERSIST group_replication_recovery_get_public_key= ON;
  
  
  --echo
  --echo ############################################################
  --echo # 4. Restart server2, it must join the group.
  --let $allow_rpl_inited= 1
  --source include/restart_mysqld.inc
  --let $rpl_server_number= 2
  --source include/rpl_reconnect.inc
  
  --let $group_replication_member_state= ONLINE
  --source include/gr_wait_for_member_state.inc
  
  --let $group_replication_number_of_members= 2
  --source include/gr_wait_for_number_of_members.inc
  
  SELECT variable_name, variable_source FROM performance_schema.variables_info WHERE variable_source IN ('PERSISTED');
  
  
  --echo
  --echo ############################################################
  --echo # 5. Clean up.
  --let $rpl_connection_name= server1
  --source include/rpl_connection.inc
  RESET PERSIST;
  SET GLOBAL group_replication_start_on_boot= OFF;
  
  --let $rpl_connection_name= server2
  --source include/rpl_connection.inc
  RESET PERSIST;
  SET GLOBAL group_replication_start_on_boot= OFF;
  
  --source include/group_replication_end.inc
  