mirror of
https://github.com/schoebel/mars
synced 2025-03-11 07:47:41 +00:00
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:
parent
634499d3d2
commit
e969219fca
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user