--- a/cmirror/src/cluster.c +++ b/cmirror/src/cluster.c @@ -458,10 +458,19 @@ open_retry: } if (rv != SA_AIS_OK) { - LOG_ERROR("[%s] Failed to open checkpoint for %u: %s", + LOG_ERROR("[%s] Failed to open checkpoint for %u: %s(%d)", SHORT_UUID(cp->uuid), cp->requester, - str_ais_error(rv)); - return -EIO; /* FIXME: better error */ + str_ais_error(rv), rv); + saCkptFinalize(ckpt_handle); + LOG_ERROR("[%s] Reinitializing checkpoint library handle", + SHORT_UUID(cp->uuid)); + rv = saCkptInitialize(&ckpt_handle, &callbacks, &version); + if (rv != SA_AIS_OK) { + LOG_ERROR("[%s] Unable to restart checkpoint library", + SHORT_UUID(cp->uuid)); + return -EIO; + } + goto open_retry; } /* @@ -610,7 +619,16 @@ open_retry: if (rv != SA_AIS_OK) { LOG_ERROR("[%s] Failed to open checkpoint: %s", SHORT_UUID(entry->name.value), str_ais_error(rv)); - return -EIO; /* FIXME: better error */ + saCkptFinalize(ckpt_handle); + LOG_ERROR("[%s] Reinitializing checkpoint library handle", + SHORT_UUID(entry->name.value)); + rv = saCkptInitialize(&ckpt_handle, &callbacks, &version); + if (rv != SA_AIS_OK) { + LOG_ERROR("[%s] Unable to restart checkpoint library", + SHORT_UUID(entry->name.value)); + return -EIO; + } + goto open_retry; } unlink_retry: