Merge from develop
Merge from develop
This commit is contained in:
@ -148,6 +148,7 @@
|
|||||||
#define BLR_MASTER_BACKOFF_TIME 10
|
#define BLR_MASTER_BACKOFF_TIME 10
|
||||||
#define BLR_MAX_BACKOFF 60
|
#define BLR_MAX_BACKOFF 60
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
/* max size for error message returned to client */
|
/* max size for error message returned to client */
|
||||||
#define BINLOG_ERROR_MSG_LEN 385
|
#define BINLOG_ERROR_MSG_LEN 385
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,6 @@ extern int lm_enabled_logfiles_bitmask;
|
|||||||
extern size_t log_ses_count[];
|
extern size_t log_ses_count[];
|
||||||
extern __thread log_info_t tls_log_info;
|
extern __thread log_info_t tls_log_info;
|
||||||
|
|
||||||
|
|
||||||
static int blr_file_create(ROUTER_INSTANCE *router, char *file);
|
static int blr_file_create(ROUTER_INSTANCE *router, char *file);
|
||||||
static void blr_file_append(ROUTER_INSTANCE *router, char *file);
|
static void blr_file_append(ROUTER_INSTANCE *router, char *file);
|
||||||
static void blr_log_header(logfile_id_t file, char *msg, uint8_t *ptr);
|
static void blr_log_header(logfile_id_t file, char *msg, uint8_t *ptr);
|
||||||
@ -1477,6 +1476,7 @@ blr_format_event_size(double *event_size, char *label)
|
|||||||
label[0] = 'B';
|
label[0] = 'B';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
/**
|
/**
|
||||||
* Read any previously saved master data
|
* Read any previously saved master data
|
||||||
*
|
*
|
||||||
|
|||||||
@ -125,37 +125,37 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
arg_vector = malloc(sizeof(char*)*(arg_count + 1));
|
arg_vector = malloc(sizeof(char*)*(arg_count + 1));
|
||||||
|
|
||||||
if(arg_vector == NULL)
|
if(arg_vector == NULL)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Error: Memory allocation failed for log manager arg_vector.\n");
|
fprintf(stderr,"Error: Memory allocation failed for log manager arg_vector.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
arg_vector[0] = "logmanager";
|
arg_vector[0] = "logmanager";
|
||||||
arg_vector[1] = "-j";
|
arg_vector[1] = "-j";
|
||||||
arg_vector[2] = "/tmp/maxbinlogcheck";
|
arg_vector[2] = "/tmp/maxbinlogcheck";
|
||||||
arg_vector[3] = "-o";
|
arg_vector[3] = "-o";
|
||||||
arg_vector[4] = NULL;
|
arg_vector[4] = NULL;
|
||||||
skygw_logmanager_init(arg_count,arg_vector);
|
skygw_logmanager_init(arg_count,arg_vector);
|
||||||
|
|
||||||
skygw_log_set_augmentation(0);
|
skygw_log_set_augmentation(0);
|
||||||
|
|
||||||
free(arg_vector);
|
free(arg_vector);
|
||||||
|
|
||||||
if (!debug_out)
|
if (!debug_out)
|
||||||
skygw_log_disable(LOGFILE_DEBUG);
|
skygw_log_disable(LOGFILE_DEBUG);
|
||||||
else
|
else
|
||||||
skygw_log_enable(LOGFILE_DEBUG);
|
skygw_log_enable(LOGFILE_DEBUG);
|
||||||
|
|
||||||
if ((inst = calloc(1, sizeof(ROUTER_INSTANCE))) == NULL) {
|
if ((inst = calloc(1, sizeof(ROUTER_INSTANCE))) == NULL) {
|
||||||
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||||
"Error: Memory allocation failed for ROUTER_INSTANCE")));
|
"Error: Memory allocation failed for ROUTER_INSTANCE")));
|
||||||
|
|
||||||
skygw_log_sync_all();
|
skygw_log_sync_all();
|
||||||
skygw_logmanager_done();
|
skygw_logmanager_done();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv[num_args] == NULL) {
|
if (argv[num_args] == NULL) {
|
||||||
printf("ERROR: No binlog file was specified\n");
|
printf("ERROR: No binlog file was specified\n");
|
||||||
@ -170,20 +170,20 @@ int main(int argc, char **argv) {
|
|||||||
fd = open(path, O_RDONLY, 0666);
|
fd = open(path, O_RDONLY, 0666);
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
LOGIF(LE, (skygw_log_write(LOGFILE_ERROR,
|
LOGIF(LE, (skygw_log_write(LOGFILE_ERROR,
|
||||||
"Failed to open binlog file %s: %s",
|
"Failed to open binlog file %s: %s",
|
||||||
path, strerror(errno))));
|
path, strerror(errno))));
|
||||||
|
|
||||||
skygw_log_sync_all();
|
skygw_log_sync_all();
|
||||||
skygw_logmanager_done();
|
skygw_logmanager_done();
|
||||||
|
|
||||||
free(inst);
|
free(inst);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inst->binlog_fd = fd;
|
inst->binlog_fd = fd;
|
||||||
|
|
||||||
if (mariadb10_compat == 1)
|
if (mariadb10_compat == 1)
|
||||||
inst->mariadb10_compat = 1;
|
inst->mariadb10_compat = 1;
|
||||||
@ -208,13 +208,11 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
close(inst->binlog_fd);
|
close(inst->binlog_fd);
|
||||||
|
|
||||||
skygw_log_sync_all();
|
|
||||||
|
|
||||||
LOGIF(LM, (skygw_log_write_flush(LOGFILE_MESSAGE,
|
LOGIF(LM, (skygw_log_write_flush(LOGFILE_MESSAGE,
|
||||||
"Check retcode: %i, Binlog Pos = %llu", ret, inst->binlog_position)));
|
"Check retcode: %i, Binlog Pos = %llu", ret, inst->binlog_position)));
|
||||||
|
|
||||||
skygw_log_sync_all();
|
skygw_log_sync_all();
|
||||||
skygw_logmanager_done();
|
skygw_logmanager_done();
|
||||||
|
|
||||||
free(inst);
|
free(inst);
|
||||||
|
|
||||||
@ -239,12 +237,11 @@ printUsage(const char *progname)
|
|||||||
printVersion(progname);
|
printVersion(progname);
|
||||||
|
|
||||||
printf("The MaxScale binlog check utility.\n\n");
|
printf("The MaxScale binlog check utility.\n\n");
|
||||||
printf("Usage: %s [-f] [-d] [-v] [<binlog file>]\n\n", progname);
|
printf("Usage: %s [-f] [-d] [-v] [<binlog file>]\n\n", progname);
|
||||||
printf(" -f|--fix Fix binlog file, require write permissions (truncate)\n");
|
printf(" -f|--fix Fix binlog file, require write permissions (truncate)\n");
|
||||||
printf(" -d|--debug Print debug messages\n");
|
printf(" -d|--debug Print debug messages\n");
|
||||||
printf(" -M|--mariadb10 MariaDB 10 binlog compatibility\n");
|
printf(" -M|--mariadb10 MariaDB 10 binlog compatibility\n");
|
||||||
printf(" -V|--version print version information and exit\n");
|
printf(" -V|--version print version information and exit\n");
|
||||||
printf(" -?|--help Print this help text\n");
|
printf(" -?|--help Print this help text\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user