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-1335 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 WSREP_SST_OPT_CONF_EXTRA  "--defaults-extra-file"
32 #define WSREP_SST_OPT_PARENT   "--parent"
33 #define WSREP_SST_OPT_BINLOG   "--binlog"
34 #define WSREP_SST_OPT_BINLOG_INDEX "--binlog-index"
35 #define WSREP_SST_OPT_MYSQLD   "--mysqld-args"
36 
37 // mysqldump-specific options
38 #define WSREP_SST_OPT_USER     "--user"
39 #define WSREP_SST_OPT_PSWD     "--password"
40 #define WSREP_SST_OPT_HOST     "--host"
41 #define WSREP_SST_OPT_PORT     "--port"
42 #define WSREP_SST_OPT_LPORT    "--local-port"
43 
44 // donor-specific
45 #define WSREP_SST_OPT_SOCKET   "--socket"
46 #define WSREP_SST_OPT_GTID     "--gtid"
47 #define WSREP_SST_OPT_BYPASS   "--bypass"
48 #define WSREP_SST_OPT_GTID_DOMAIN_ID "--gtid-domain-id"
49 
50 #define WSREP_SST_MYSQLDUMP    "mysqldump"
51 #define WSREP_SST_RSYNC        "rsync"
52 #define WSREP_SST_SKIP         "skip"
53 #define WSREP_SST_MARIABACKUP  "mariabackup"
54 #define WSREP_SST_XTRABACKUP   "xtrabackup"
55 #define WSREP_SST_XTRABACKUPV2 "xtrabackupv2"
56 #define WSREP_SST_DEFAULT      WSREP_SST_RSYNC
57 #define WSREP_SST_ADDRESS_AUTO "AUTO"
58 #define WSREP_SST_AUTH_MASK    "********"
59 
60 /* system variables */
61 extern const char* wsrep_sst_method;
62 extern const char* wsrep_sst_receive_address;
63 extern const char* wsrep_sst_donor;
64 extern const char* wsrep_sst_auth;
65 extern my_bool wsrep_sst_donor_rejects_queries;
66 
67 /*! Synchronizes applier thread start with init thread */
68 extern void wsrep_sst_grab();
69 /*! Init thread waits for SST completion */
70 extern bool wsrep_sst_wait();
71 /*! Signals wsrep that initialization is complete, writesets can be applied */
72 extern bool wsrep_sst_continue();
73 extern void wsrep_sst_auth_init();
74 extern void wsrep_sst_auth_free();
75 
76 extern void wsrep_SE_init_grab();   /*! grab init critical section */
77 extern void wsrep_SE_init_wait();   /*! wait for SE init to complete */
78 extern void wsrep_SE_init_done();   /*! signal that SE init is complte */
79 extern void wsrep_SE_initialized(); /*! mark SE initialization complete */
80 
81 #else
82 #define wsrep_SE_initialized() do { } while(0)
83 #define wsrep_SE_init_grab() do { } while(0)
84 #define wsrep_SE_init_done() do { } while(0)
85 #define wsrep_sst_continue() (0)
86 
87 #endif /* WITH_WSREP */
88 #endif /* WSREP_SST_H */
89