mirror of https://github.com/apache/druid.git
Fixing overlord unable to become a leader when syncing the lock from metadata store. (#14038)
This commit is contained in:
parent
d52bc333aa
commit
8712098301
|
@ -201,7 +201,6 @@ public class TaskLockbox
|
||||||
task.getId(),
|
task.getId(),
|
||||||
task.getGroupId()
|
task.getGroupId()
|
||||||
);
|
);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,6 +236,7 @@ public class TaskLockbox
|
||||||
* groupId, dataSource, and priority.
|
* groupId, dataSource, and priority.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
@Nullable
|
||||||
protected TaskLockPosse verifyAndCreateOrFindLockPosse(Task task, TaskLock taskLock)
|
protected TaskLockPosse verifyAndCreateOrFindLockPosse(Task task, TaskLock taskLock)
|
||||||
{
|
{
|
||||||
giant.lock();
|
giant.lock();
|
||||||
|
@ -297,6 +297,12 @@ public class TaskLockbox
|
||||||
|
|
||||||
return createOrFindLockPosse(request);
|
return createOrFindLockPosse(request);
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
log.error(e,
|
||||||
|
"Could not reacquire lock for task: %s from metadata store", task.getId()
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
finally {
|
finally {
|
||||||
giant.unlock();
|
giant.unlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -449,9 +449,9 @@ public class TaskLockboxTest
|
||||||
);
|
);
|
||||||
|
|
||||||
final TaskLockbox lockbox = new TaskLockbox(taskStorage, metadataStorageCoordinator);
|
final TaskLockbox lockbox = new TaskLockbox(taskStorage, metadataStorageCoordinator);
|
||||||
expectedException.expect(IllegalArgumentException.class);
|
TaskLockboxSyncResult result = lockbox.syncFromStorage();
|
||||||
expectedException.expectMessage("lock priority[10] is different from task priority[50]");
|
Assert.assertEquals(1, result.getTasksToFail().size());
|
||||||
lockbox.syncFromStorage();
|
Assert.assertTrue(result.getTasksToFail().contains(task));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue