← Back to team overview

maria-developers team mailing list archive

Please review: [Commits] Rev 3797: MDEV-4816: rpl.rpl_trunc_temp fails in 10.0-serg in file:///data0/psergey/dev2/10.0-serg/

 

Hi Kristian,

In order to get rid of test failures of 10.0-serg, I have pushed the below
patch. It seems to have the right effect, but I have no confidence about this
patch being achitecturally correct, etc. 

Could you please review this and/or make another fix for the problem?

----- Forwarded message from Sergey Petrunya <psergey@xxxxxxxxxxxx> -----

From: Sergey Petrunya <psergey@xxxxxxxxxxxx>
To: commits@xxxxxxxxxxx
X-Mailer: mail (GNU Mailutils 2.2)
Date: Fri,  2 Aug 2013 18:12:11 +0400 (MSK)
Subject: [Commits] Rev 3797: MDEV-4816: rpl.rpl_trunc_temp fails in
	10.0-serg in file:///data0/psergey/dev2/10.0-serg/

At file:///data0/psergey/dev2/10.0-serg/

------------------------------------------------------------
revno: 3797
revision-id: psergey@xxxxxxxxxxxx-20130802141209-4dqfvx2db8acxwbl
parent: svoj@xxxxxxxxxxx-20130729140849-dciz5ffq25ciip6q
committer: Sergey Petrunya <psergey@xxxxxxxxxxxx>
branch nick: 10.0-serg
timestamp: Fri 2013-08-02 18:12:09 +0400
message:
  MDEV-4816: rpl.rpl_trunc_temp fails in 10.0-serg
  Temorary fix for a number of replication tests (rpl.rpl_temp_table_mix_row 
  rpl.rpl_trunc_temp rpl.rpl_current_user rpl.rpl_gtid_master_promote):
  
  - THD::decide_logging_format() should not assume that mysql.gtid_slave_pos is 
    a non-replicated table. This used to cause unintended behavior for COMMIT 
    statement: replication would switch to row-based, etc.
  
  The question of what should be done when a user issues a statement that
  explicitly modifies mysql.gtid_slave_pos table remains open.
=== modified file 'sql/rpl_gtid.cc'
--- a/sql/rpl_gtid.cc	2013-06-21 09:53:46 +0000
+++ b/sql/rpl_gtid.cc	2013-08-02 14:12:09 +0000
@@ -210,6 +210,7 @@ rpl_slave_state::truncate_state_table(TH
   {
     table= tlist.table;
     table->no_replicate= 1;
+    table->s->is_gtid_slave_pos= TRUE; // TEMPORARY CODE
     err= table->file->ha_truncate();
 
     if (err)
@@ -346,6 +347,7 @@ rpl_slave_state::record_gtid(THD *thd, c
     goto end;
 
   table->no_replicate= 1;
+  table->s->is_gtid_slave_pos= TRUE; // TEMPORARY CODE
   if (!in_transaction)
     thd->variables.option_bits&=
       ~(ulonglong)(OPTION_NOT_AUTOCOMMIT|OPTION_BEGIN);

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2013-07-24 10:43:57 +0000
+++ b/sql/sql_class.cc	2013-08-02 14:12:09 +0000
@@ -5001,7 +5001,7 @@ int THD::decide_logging_format(TABLE_LIS
       DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx",
                           table->table_name, flags));
 
-      if (table->table->no_replicate)
+      if (table->table->no_replicate && !table->table->s->is_gtid_slave_pos)
       {
         /*
           The statement uses a table that is not replicated.

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2013-07-21 14:43:42 +0000
+++ b/sql/table.cc	2013-08-02 14:12:09 +0000
@@ -315,6 +315,8 @@ TABLE_SHARE *alloc_table_share(const cha
     strmov(share->path.str, path);
     share->normalized_path.str=    share->path.str;
     share->normalized_path.length= path_length;
+    /* TEMPORARY FIX: if true, this means this is mysql.gtid_slave_pos table */
+    share->is_gtid_slave_pos= FALSE;
     share->table_category= get_table_category(& share->db, & share->table_name);
     share->set_refresh_version();
     share->open_errno= ENOENT;

=== modified file 'sql/table.h'
--- a/sql/table.h	2013-07-21 14:39:19 +0000
+++ b/sql/table.h	2013-08-02 14:12:09 +0000
@@ -644,6 +644,8 @@ struct TABLE_SHARE
   LEX_STRING normalized_path;		/* unpack_filename(path) */
   LEX_STRING connect_string;
 
+  bool is_gtid_slave_pos;
+
   /* 
      Set of keys in use, implemented as a Bitmap.
      Excludes keys disabled by ALTER TABLE ... DISABLE KEYS.

_______________________________________________
commits mailing list
commits@xxxxxxxxxxx
https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits

----- End forwarded message -----

-- 
BR
 Sergei
-- 
Sergei Petrunia, Software Developer
Monty Program AB, http://askmonty.org
Blog: http://s.petrunia.net/blog