~akopytov/percona-server/bug797944

« back to all changes in this revision

Viewing changes to replication_skip_single_statement.patch

  • Committer: Oleg Tsarev
  • Date: 2011-06-15 21:57:04 UTC
  • mfrom: (170.1.2 rnt_rebase)
  • Revision ID: oleg.tsarev@percona.com-20110615215704-57l80gh5t12m93j5
port to 5.1.57 (merge with lp:percona-server/5.1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
diff -ruN a/sql/log_event.cc b/sql/log_event.cc
9
9
--- a/sql/log_event.cc  2010-08-25 17:30:08.081583569 +0400
10
10
+++ b/sql/log_event.cc  2010-08-25 20:11:01.841725638 +0400
11
 
@@ -816,12 +816,18 @@
 
11
@@ -821,12 +821,18 @@
12
12
 {
13
13
   DBUG_PRINT("info", ("ev->server_id=%lu, ::server_id=%lu,"
14
14
                       " rli->replicate_same_server_id=%d,"
31
31
     return EVENT_SKIP_IGNORE;
32
32
   else if (rli->slave_skip_counter > 0)
33
33
     return EVENT_SKIP_COUNT;
34
 
@@ -2096,9 +2102,12 @@
 
34
@@ -2103,9 +2109,12 @@
35
35
 inline Log_event::enum_skip_reason
36
36
 Log_event::continue_group(Relay_log_info *rli)
37
37
 {
46
46
 }
47
47
 #endif
48
48
 
49
 
@@ -3471,7 +3480,7 @@
 
49
@@ -3484,7 +3493,7 @@
50
50
   DBUG_PRINT("debug", ("query: %s; q_len: %d", query, q_len));
51
51
   DBUG_ASSERT(query && q_len > 0);
52
52
 
55
55
   {
56
56
     if (strcmp("BEGIN", query) == 0)
57
57
     {
58
 
@@ -5465,7 +5474,8 @@
 
58
@@ -5478,7 +5487,8 @@
59
59
 Xid_log_event::do_shall_skip(Relay_log_info *rli)
60
60
 {
61
61
   DBUG_ENTER("Xid_log_event::do_shall_skip");
65
65
     thd->options&= ~OPTION_BEGIN;
66
66
     DBUG_RETURN(Log_event::EVENT_SKIP_COUNT);
67
67
   }
68
 
@@ -7735,7 +7745,11 @@
 
68
@@ -7762,7 +7772,11 @@
69
69
     statement, then we should not start executing on the next event.
70
70
     Otherwise, we defer the decision to the normal skipping logic.
71
71
   */
123
123
diff -ruN a/sql/rpl_rli.h b/sql/rpl_rli.h
124
124
--- a/sql/rpl_rli.h     2010-08-25 17:30:08.021582071 +0400
125
125
+++ b/sql/rpl_rli.h     2010-08-25 17:30:40.351581364 +0400
126
 
@@ -199,6 +199,7 @@
 
126
@@ -209,6 +209,7 @@
127
127
     errors, and have been manually applied by DBA already.
128
128
   */
129
129
   volatile uint32 slave_skip_counter;
134
134
diff -ruN a/sql/slave.cc b/sql/slave.cc
135
135
--- a/sql/slave.cc      2010-08-25 17:30:07.911581466 +0400
136
136
+++ b/sql/slave.cc      2010-08-25 20:11:21.091602163 +0400
137
 
@@ -1596,6 +1596,8 @@
 
137
@@ -1605,6 +1605,8 @@
138
138
   field_list.push_back(new Item_empty_string("Last_Error", 20));
139
139
   field_list.push_back(new Item_return_int("Skip_Counter", 10,
140
140
                                            MYSQL_TYPE_LONG));
143
143
   field_list.push_back(new Item_return_int("Exec_Master_Log_Pos", 10,
144
144
                                            MYSQL_TYPE_LONGLONG));
145
145
   field_list.push_back(new Item_return_int("Relay_Log_Space", 10,
146
 
@@ -1677,6 +1679,7 @@
 
146
@@ -1686,6 +1688,7 @@
147
147
     protocol->store(mi->rli.last_error().number);
148
148
     protocol->store(mi->rli.last_error().message, &my_charset_bin);
149
149
     protocol->store((uint32) mi->rli.slave_skip_counter);
151
151
     protocol->store((ulonglong) mi->rli.group_master_log_pos);
152
152
     protocol->store((ulonglong) mi->rli.log_space_total);
153
153
 
154
 
@@ -2152,7 +2155,12 @@
 
154
@@ -2161,7 +2164,12 @@
155
155
 
156
156
   int reason= ev->shall_skip(rli);
157
157
   if (reason == Log_event::EVENT_SKIP_COUNT)
165
165
   pthread_mutex_unlock(&rli->data_lock);
166
166
   if (reason == Log_event::EVENT_SKIP_NOT)
167
167
     exec_res= ev->apply_event(rli);
168
 
@@ -2915,7 +2923,7 @@
 
168
@@ -2924,7 +2932,7 @@
169
169
   char saved_master_log_name[FN_REFLEN];
170
170
   my_off_t UNINIT_VAR(saved_log_pos);
171
171
   my_off_t UNINIT_VAR(saved_master_log_pos);
174
174
 
175
175
   Relay_log_info* rli = &((Master_info*)arg)->rli;
176
176
   const char *errmsg;
177
 
@@ -3067,13 +3075,14 @@
 
177
@@ -3076,13 +3084,14 @@
178
178
     do not want to wait for next event in this case.
179
179
   */
180
180
   pthread_mutex_lock(&rli->data_lock);
190
190
   }
191
191
   if (rli->until_condition != Relay_log_info::UNTIL_NONE &&
192
192
       rli->is_until_satisfied(thd, NULL))
193
 
@@ -3094,18 +3103,19 @@
 
193
@@ -3103,18 +3112,19 @@
194
194
     DBUG_ASSERT(rli->sql_thd == thd);
195
195
     THD_CHECK_SENTRY(thd);
196
196
 
216
216
diff -ruN a/sql/sql_repl.cc b/sql/sql_repl.cc
217
217
--- a/sql/sql_repl.cc   2010-08-25 17:30:07.931584852 +0400
218
218
+++ b/sql/sql_repl.cc   2010-08-25 17:31:56.601593101 +0400
219
 
@@ -1769,6 +1769,15 @@
 
219
@@ -1799,6 +1799,15 @@
220
220
   */
221
221
 };
222
222
 
232
232
 class sys_var_sync_binlog_period :public sys_var_long_ptr
233
233
 {
234
234
 public:
235
 
@@ -1815,6 +1824,7 @@
 
235
@@ -1845,6 +1854,7 @@
236
236
 static sys_var_long_ptr        sys_slave_trans_retries(&vars, "slave_transaction_retries",
237
237
                                                &slave_trans_retries);
238
238
 static sys_var_sync_binlog_period sys_sync_binlog_period(&vars, "sync_binlog", &sync_binlog_period);
240
240
 static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter");
241
241
 
242
242
 
243
 
@@ -1855,6 +1865,26 @@
 
243
@@ -1885,6 +1895,26 @@
244
244
   return 0;
245
245
 }
246
246