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.getGroupId()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,6 +236,7 @@ public class TaskLockbox
|
|||
* groupId, dataSource, and priority.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
@Nullable
|
||||
protected TaskLockPosse verifyAndCreateOrFindLockPosse(Task task, TaskLock taskLock)
|
||||
{
|
||||
giant.lock();
|
||||
|
@ -297,6 +297,12 @@ public class TaskLockbox
|
|||
|
||||
return createOrFindLockPosse(request);
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e,
|
||||
"Could not reacquire lock for task: %s from metadata store", task.getId()
|
||||
);
|
||||
return null;
|
||||
}
|
||||
finally {
|
||||
giant.unlock();
|
||||
}
|
||||
|
|
|
@ -449,9 +449,9 @@ public class TaskLockboxTest
|
|||
);
|
||||
|
||||
final TaskLockbox lockbox = new TaskLockbox(taskStorage, metadataStorageCoordinator);
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
expectedException.expectMessage("lock priority[10] is different from task priority[50]");
|
||||
lockbox.syncFromStorage();
|
||||
TaskLockboxSyncResult result = lockbox.syncFromStorage();
|
||||
Assert.assertEquals(1, result.getTasksToFail().size());
|
||||
Assert.assertTrue(result.getTasksToFail().contains(task));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue