| 1 | /* Copyright (C) 2013 Codership Oy <info@codership.com> |
| 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 along |
| 13 | with this program; if not, write to the Free Software Foundation, Inc., |
| 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ |
| 15 | |
| 16 | #include <my_config.h> |
| 17 | |
| 18 | #ifndef WSREP_SST_H |
| 19 | #define WSREP_SST_H |
| 20 | |
| 21 | #ifdef WITH_WSREP |
| 22 | |
| 23 | #include <mysql.h> // my_bool |
| 24 | |
| 25 | #define WSREP_SST_OPT_ROLE "--role" |
| 26 | #define WSREP_SST_OPT_ADDR "--address" |
| 27 | #define WSREP_SST_OPT_AUTH "--auth" |
| 28 | #define WSREP_SST_OPT_DATA "--datadir" |
| 29 | #define WSREP_SST_OPT_CONF "--defaults-file" |
| 30 | #define WSREP_SST_OPT_CONF_SUFFIX "--defaults-group-suffix" |
| 31 | #define "--defaults-extra-file" |
| 32 | #define WSREP_SST_OPT_PARENT "--parent" |
| 33 | #define WSREP_SST_OPT_BINLOG "--binlog" |
| 34 | |
| 35 | // mysqldump-specific options |
| 36 | #define WSREP_SST_OPT_USER "--user" |
| 37 | #define WSREP_SST_OPT_PSWD "--password" |
| 38 | #define WSREP_SST_OPT_HOST "--host" |
| 39 | #define WSREP_SST_OPT_PORT "--port" |
| 40 | #define WSREP_SST_OPT_LPORT "--local-port" |
| 41 | |
| 42 | // donor-specific |
| 43 | #define WSREP_SST_OPT_SOCKET "--socket" |
| 44 | #define WSREP_SST_OPT_GTID "--gtid" |
| 45 | #define WSREP_SST_OPT_BYPASS "--bypass" |
| 46 | #define WSREP_SST_OPT_GTID_DOMAIN_ID "--gtid-domain-id" |
| 47 | |
| 48 | #define WSREP_SST_MYSQLDUMP "mysqldump" |
| 49 | #define WSREP_SST_RSYNC "rsync" |
| 50 | #define WSREP_SST_SKIP "skip" |
| 51 | #define WSREP_SST_DEFAULT WSREP_SST_RSYNC |
| 52 | #define WSREP_SST_ADDRESS_AUTO "AUTO" |
| 53 | #define WSREP_SST_AUTH_MASK "********" |
| 54 | |
| 55 | /* system variables */ |
| 56 | extern const char* wsrep_sst_method; |
| 57 | extern const char* wsrep_sst_receive_address; |
| 58 | extern const char* wsrep_sst_donor; |
| 59 | extern const char* wsrep_sst_auth; |
| 60 | extern my_bool wsrep_sst_donor_rejects_queries; |
| 61 | |
| 62 | /*! Synchronizes applier thread start with init thread */ |
| 63 | extern void wsrep_sst_grab(); |
| 64 | /*! Init thread waits for SST completion */ |
| 65 | extern bool wsrep_sst_wait(); |
| 66 | /*! Signals wsrep that initialization is complete, writesets can be applied */ |
| 67 | extern bool wsrep_sst_continue(); |
| 68 | extern void wsrep_sst_auth_init(); |
| 69 | extern void wsrep_sst_auth_free(); |
| 70 | |
| 71 | extern void wsrep_SE_init_grab(); /*! grab init critical section */ |
| 72 | extern void wsrep_SE_init_wait(); /*! wait for SE init to complete */ |
| 73 | extern void wsrep_SE_init_done(); /*! signal that SE init is complte */ |
| 74 | extern void wsrep_SE_initialized(); /*! mark SE initialization complete */ |
| 75 | |
| 76 | #else |
| 77 | #define wsrep_SE_initialized() do { } while(0) |
| 78 | #define wsrep_SE_init_grab() do { } while(0) |
| 79 | #define wsrep_SE_init_done() do { } while(0) |
| 80 | #define wsrep_sst_continue() (0) |
| 81 | |
| 82 | #endif /* WITH_WSREP */ |
| 83 | #endif /* WSREP_SST_H */ |
| 84 | |