Skip to content

Commit 0e4e7c4

Browse files
committed
Merge branch 'mysql-8.0' into mysql-trunk
Change-Id: Ib9e34bf0610389d92210cd9987b619d38b86d27e
2 parents 320612c + 9eec5be commit 0e4e7c4

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

storage/ndb/include/util/ndb_opts.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ OPT_EXTERN(const char *,opt_debug,= 0);
106106
{"connect-retries", NDB_OPT_NOSHORT, \
107107
"Set connection retries." \
108108
" This is the number of times the tool tries connecting" \
109-
" to the cluster.", \
109+
" to the cluster. -1 for eternal retries", \
110110
(uchar**) &opt_connect_retries, (uchar**) &opt_connect_retries, 0, GET_INT, \
111-
REQUIRED_ARG, 12, 0, INT_MAX, 0, 0, 0}
111+
REQUIRED_ARG, 12, -1, INT_MAX, 0, 0, 0}
112112

113113
#ifndef NDEBUG
114114
#define NDB_STD_OPTS(prog_name) \

storage/ndb/src/kernel/main.cpp

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ static int opt_initial;
4949
static int opt_no_start;
5050
static unsigned opt_allocated_nodeid;
5151
static int opt_angel_pid;
52-
static int opt_retries;
53-
static int opt_delay;
5452
static unsigned long opt_logbuffer_size;
5553

5654
extern NdbNodeBitmask g_nowait_nodes;
@@ -109,13 +107,11 @@ static struct my_option my_long_options[] =
109107
(uchar**) &opt_angel_pid, (uchar **) &opt_angel_pid, 0,
110108
GET_UINT, REQUIRED_ARG, 0, 0, UINT_MAX, 0, 0, 0 },
111109
{ "connect-retries", 'r',
112-
"Number of times mgmd is contacted at start. -1: eternal retries",
113-
(uchar**) &opt_retries, (uchar**) &opt_retries, 0,
110+
"Number of times mgmd is contacted at start. -1: eternal retries"
111+
" NOTE: -r will be removed with the next release!"
112+
" Use --connect-retries instead",
113+
(uchar**) &opt_connect_retries, (uchar**) &opt_connect_retries, 0,
114114
GET_INT, REQUIRED_ARG, 12, -1, 65535, 0, 0, 0 },
115-
{ "connect-delay", NDB_OPT_NOSHORT,
116-
"Number of seconds between each connection attempt",
117-
(uchar**) &opt_delay, (uchar**) &opt_delay, 0,
118-
GET_INT, REQUIRED_ARG, 5, 0, 3600, 0, 0, 0 },
119115
{ "logbuffer-size", NDB_OPT_NOSHORT,
120116
"Size of the log buffer for data node ndb_x_out.log",
121117
(uchar**) &opt_logbuffer_size, (uchar**) &opt_logbuffer_size, 0,
@@ -137,6 +133,15 @@ static void short_usage_sub(void)
137133
ndb_service_print_options("ndbd");
138134
}
139135

136+
static bool get_one_option(int optid, const struct my_option *opt,
137+
char *argument) {
138+
if (optid == 'r')
139+
g_eventLogger->warning(
140+
"NOTE: -r option will be removed in the next release!"
141+
" Use --connect-retries instead.");
142+
return ndb_std_get_one_option(optid, opt, argument);
143+
}
144+
140145
/**
141146
* C++ Standard 3.6.1/3:
142147
* The function main shall not be used (3.2) within a program.
@@ -180,7 +185,7 @@ real_main(int argc, char** argv)
180185
}
181186

182187
int ho_error;
183-
if ((ho_error=opts.handle_options()))
188+
if ((ho_error=opts.handle_options(get_one_option)))
184189
exit(ho_error);
185190

186191
if (opt_no_daemon || opt_foreground) {
@@ -225,7 +230,7 @@ real_main(int argc, char** argv)
225230
ndbd_run(opt_foreground, opt_report_fd,
226231
opt_ndb_connectstring, opt_ndb_nodeid, opt_bind_address,
227232
opt_no_start, opt_initial, opt_initialstart,
228-
opt_allocated_nodeid, opt_retries, opt_delay,
233+
opt_allocated_nodeid, opt_connect_retries, opt_connect_retry_delay,
229234
opt_logbuffer_size);
230235
}
231236

@@ -244,8 +249,8 @@ real_main(int argc, char** argv)
244249
opt_initial,
245250
opt_no_start,
246251
opt_daemon,
247-
opt_retries,
248-
opt_delay);
252+
opt_connect_retries,
253+
opt_connect_retry_delay);
249254

250255
return 1; // Never reached
251256
}

0 commit comments

Comments
 (0)