[MDEV-32004] Parse error in mtr tests when using $rpl_check_server_ids Created: 2023-08-24  Updated: 2023-09-19  Resolved: 2023-09-14

Status: Closed
Project: MariaDB Server
Component/s: Replication, Tests
Affects Version/s: 10.4.31
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.1.3

Type: Bug Priority: Major
Reporter: Anel Husakovic Assignee: Anel Husakovic
Resolution: Fixed Votes: 0
Labels: None

Attachments: File rpl_init_test_assert.cnf     File rpl_init_test_assert.result     File rpl_init_test_assert.test    

 Description   

Task of this MDEV (and related commits) should be:

  1. Make rpl_check_server_ids work again.
  2. Remove extra connections namely server_[1,2,..]_1, that were created during initalization in rpl_init.inc, recreated in rpl_reconnect.inc and removed in rpl_end.inc.
    They are dead connections, not used anywhere in rpl suite.
  3. Cosmetic fixes
    • Fix errors in `rpl_init.inc` regarding the comments
      • sed 's/.cfg/.cnf/'
      • Verifying server_id is not by default but with using rpl_check_server_ids parameter.
      • Add comment why extra connections server_[i,..,N]_1 are needed, since there is no usage of env variables [MASTER,SLAVE]_PORT1 except in rpl_show_slave_hosts.test.
    • Cleanup type,style cleanup
  1. For the first part, consider the test case with configuration options
    • Config rpl_anel.cnf

      !include ../my.cnf
      

    • Test case rpl_anel.test

      --let $rpl_debug= 1
      --let $rpl_check_server_ids= 1
      --source include/master-slave.inc
      SELECT 1;
       
      # End of tests
      --source include/rpl_end.inc
      
      

    • When setting rpl_check_server_ids parsing error is raised

      ---- Check that @@server_id is distinct for all servers ----
      ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
      .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
      # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond=''
      # debug: interpolated_cond=''
       
      CURRENT_TEST: rpl.rpl_anel
      mysqltest: In included file "./include/assert.inc": 
      included from ./include/rpl_init.inc at line 209:
      included from ./include/master-slave.inc at line 39:
      included from /home/anel/GitHub/mariadb/server/src/10.11/mysql-test/suite/rpl/t/rpl_anel.test at line 4:
      At line 148: query 'let $_assert_result= `SELECT $_assert_cond_interp`' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
      

    • This error is obtained from mysql-test/include/rpl_init.inc file, when invoking ./include/assert.inc.
    • As proof of working feature attach the test file with rpl_debug enabled, since currently result file cannot be saved with rpl_debug that is storing the PORT numbers, that are failing in buildbot.


 Comments   
Comment by Anel Husakovic [ 2023-09-14 ]
  • With suggested patch we get the desired output; that means using rpl_check_server_ids as an argument in test now works:

    ---- Check that @@server_id is distinct for all servers ----
    ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
    .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
    # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond='[SELECT @@server_id AS i, i, 1] != 2'
    # debug: old connection, sub-statement='SELECT @@server_id AS i, i, 1'
    # debug: result of sub-statement='1'
    # debug: interpolated_cond='1 != 2'
    # debug: result='1'
    [connection server_1]
    ..==== END include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
    .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
    

  • Full result file is in the attachment of this task.
Generated at Thu Feb 08 10:28:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.