~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/slave.h

  • Committer: Patrick Galbraith
  • Date: 2008-07-24 16:57:40 UTC
  • mto: (202.2.4 rename-mysql-to-drizzle)
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: patg@ishvara-20080724165740-x58yw6zs6d9o17lf
Most everything working with client rename
mysqlslap test still fails... can't connect to the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
#ifndef DRIZZLE_SERVER_SLAVE_H
21
 
#define DRIZZLE_SERVER_SLAVE_H
 
1
/* Copyright (C) 2000-2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef SLAVE_H
 
17
#define SLAVE_H
22
18
 
23
19
/**
24
20
  @defgroup Replication Replication
37
33
*/
38
34
#define SLAVE_MAX_HEARTBEAT_PERIOD 4294967
39
35
 
 
36
#ifdef HAVE_REPLICATION
 
37
 
40
38
#include "log.h"
41
 
#include <mysys/my_list.h>
 
39
#include "my_list.h"
42
40
#include "rpl_filter.h"
43
41
#include "rpl_tblmap.h"
44
42
 
95
93
  run_lock protects all information about the run state: slave_running, thd
96
94
  and the existence of the I/O thread to stop/start it, you need this mutex).
97
95
  data_lock protects some moving members of the struct: counters (log name,
98
 
  position) and relay log (DRIZZLE_BIN_LOG object).
 
96
  position) and relay log (MYSQL_BIN_LOG object).
99
97
 
100
98
  In Relay_log_info: run_lock, data_lock
101
99
  see Master_info
103
101
  Order of acquisition: if you want to have LOCK_active_mi and a run_lock, you
104
102
  must acquire LOCK_active_mi first.
105
103
 
106
 
  In DRIZZLE_BIN_LOG: LOCK_log, LOCK_index of the binlog and the relay log
 
104
  In MYSQL_BIN_LOG: LOCK_log, LOCK_index of the binlog and the relay log
107
105
  LOCK_log: when you write to it. LOCK_index: when you create/delete a binlog
108
106
  (so that you have to update the .index file).
109
107
*/
130
128
  I started with using an enum, but
131
129
  enum_variable=1; is not legal so would have required many line changes.
132
130
*/
133
 
#define DRIZZLE_SLAVE_NOT_RUN         0
134
 
#define DRIZZLE_SLAVE_RUN_NOT_CONNECT 1
135
 
#define DRIZZLE_SLAVE_RUN_CONNECT     2
 
131
#define MYSQL_SLAVE_NOT_RUN         0
 
132
#define MYSQL_SLAVE_RUN_NOT_CONNECT 1
 
133
#define MYSQL_SLAVE_RUN_CONNECT     2
136
134
 
137
 
#define RPL_LOG_NAME (rli->group_master_log_name.length() ? rli->group_master_log_name.c_str() : "FIRST")
138
 
#define IO_RPL_LOG_NAME (mi->getLogName() ? mi->getLogName() : "FIRST")
 
135
#define RPL_LOG_NAME (rli->group_master_log_name[0] ? rli->group_master_log_name :\
 
136
 "FIRST")
 
137
#define IO_RPL_LOG_NAME (mi->master_log_name[0] ? mi->master_log_name :\
 
138
 "FIRST")
139
139
 
140
140
/*
141
141
  If the following is set, if first gives an error, second will be
197
197
int32_t purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
198
198
                     const char** errmsg);
199
199
void set_slave_thread_options(THD* thd);
 
200
void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli);
200
201
void rotate_relay_log(Master_info* mi);
201
202
int32_t apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli,
202
203
                               bool skip);
222
223
       
223
224
extern I_List<THD> threads;
224
225
 
 
226
#endif /* HAVE_REPLICATION */
 
227
 
225
228
/* masks for start/stop operations on io and sql slave threads */
226
229
#define SLAVE_IO  1
227
230
#define SLAVE_SQL 2
230
233
  @} (end of group Replication)
231
234
*/
232
235
 
233
 
#endif /* DRIZZLE_SERVER_SLAVE_H */
 
236
#endif