main: safeguard versionlink appearance

In some rare cases (e.g. damaged /mars or crashed primaries),
the versionlink belonging to a  logfile may be missing.

Don't insist on the existence of a versionlink if the logfile is
stemming from myself (automatic self-repair).
This commit is contained in:
Thomas Schoebel-Theuer 2016-05-24 08:28:31 +02:00
parent 634499d3d2
commit e969219fca
1 changed files with 1 additions and 1 deletions

View File

@ -2611,7 +2611,7 @@ bool is_switchover_possible(struct mars_rotate *rot, const char *old_log_path, c
make_rot_msg(rot, "err-versionlink-not-readable", "cannot read old versionlink '%s'", SAFE_STR(old_versionlink_path));
goto done;
}
if (!skip_new) {
if (!skip_new && strcmp(new_host, my_id())) {
new_versionlink = get_versionlink(rot->parent_path, new_log_seq, new_host, &new_versionlink_path);
if (unlikely(!new_versionlink || !new_versionlink[0])) {
MARS_INF_TO(rot->log_say, "new versionlink '%s' does not yet exist, we must wait for it.\n", SAFE_STR(new_versionlink_path));