Failure to recover after segment reload failure does not release segment lock
Fix the bug of not releasing segment lock if segment recovery throws exception
@@ -236,8 +236,15 @@ public class HelixInstanceDataManager implements InstanceDataManager {
// Delete segment temporary directory
FileUtils.deleteDirectory(segmentTempDir);
- } finally {
+ } catch (Exception reloadFailureException) {
+ try {
LoaderUtils.reloadFailureRecovery(indexDir);
+ } catch (Exception recoveryFailureException) {
+ LOGGER.error("Failed to recover after reload failure", recoveryFailureException);
+ reloadFailureException.addSuppressed(recoveryFailureException);
+ }
+ throw reloadFailureException;
+ } finally {
segmentLock.unlock();
}
}
