You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.6 KiB

  1. /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB & Sasha
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  13. #include "rpl_filter.h"
  14. #ifdef HAVE_REPLICATION
  15. #include "slave.h"
  16. typedef struct st_slave_info
  17. {
  18. uint32 server_id;
  19. uint32 rpl_recovery_rank, master_id;
  20. char host[HOSTNAME_LENGTH+1];
  21. char user[USERNAME_LENGTH+1];
  22. char password[MAX_PASSWORD_LENGTH+1];
  23. uint16 port;
  24. THD* thd;
  25. } SLAVE_INFO;
  26. extern my_bool opt_show_slave_auth_info;
  27. extern char *master_host, *master_info_file;
  28. extern bool server_id_supplied;
  29. extern int max_binlog_dump_events;
  30. extern my_bool opt_sporadic_binlog_dump_fail;
  31. #define KICK_SLAVE(thd) do { \
  32. pthread_mutex_lock(&(thd)->LOCK_delete); \
  33. (thd)->awake(THD::NOT_KILLED); \
  34. pthread_mutex_unlock(&(thd)->LOCK_delete); \
  35. } while(0)
  36. int start_slave(THD* thd, MASTER_INFO* mi, bool net_report);
  37. int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report);
  38. bool change_master(THD* thd, MASTER_INFO* mi);
  39. bool mysql_show_binlog_events(THD* thd);
  40. int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
  41. const char* log_file_name2, ulonglong log_pos2);
  42. int reset_slave(THD *thd, MASTER_INFO* mi);
  43. int reset_master(THD* thd);
  44. bool purge_master_logs(THD* thd, const char* to_log);
  45. bool purge_master_logs_before_date(THD* thd, time_t purge_time);
  46. bool log_in_use(const char* log_name);
  47. void adjust_linfo_offsets(my_off_t purge_offset);
  48. bool show_binlogs(THD* thd);
  49. extern int init_master_info(MASTER_INFO* mi);
  50. void kill_zombie_dump_threads(uint32 slave_server_id);
  51. int check_binlog_magic(IO_CACHE* log, const char** errmsg);
  52. typedef struct st_load_file_info
  53. {
  54. THD* thd;
  55. my_off_t last_pos_in_file;
  56. bool wrote_create_file, log_delayed;
  57. } LOAD_FILE_INFO;
  58. int log_loaded_block(IO_CACHE* file);
  59. #endif /* HAVE_REPLICATION */