Added blr_check_binlog at router startup if trx_safe is set

Added blr_check_binlog at router startup if trx_safe is set
This commit is contained in:
MassimilianoPinto
2015-08-07 11:59:15 +02:00
parent e5a2e5cd1f
commit 479e4e3203
4 changed files with 115 additions and 60 deletions

View File

@ -1008,14 +1008,16 @@ int found_chksum = 0;
"warning : an error has been found. "
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 1;
} else {
router->binlog_position = pos;
router->current_pos = pos;
return 0;
}
}
@ -1054,8 +1056,10 @@ int found_chksum = 0;
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 1;
}
@ -1074,9 +1078,10 @@ int found_chksum = 0;
"warning : an error has been found. "
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 1;
}
@ -1097,8 +1102,10 @@ int found_chksum = 0;
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 1;
}
@ -1143,9 +1150,10 @@ int found_chksum = 0;
"warning : an error has been found. "
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 1;
}
@ -1332,9 +1340,10 @@ int found_chksum = 0;
"warning : an error has been found. "
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 2;
}
@ -1356,8 +1365,10 @@ int found_chksum = 0;
"Setting safe pos to %lu, current pos %lu",
router->binlog_position, router->current_pos)));
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
if (fix) {
ftruncate(router->binlog_fd, router->binlog_position);
fsync(router->binlog_fd);
}
return 2;
}