Today, when SegmentAllocateAction is run by multiple threads at once, it can end up doing a lot of internal retries due to its SELECT -> INSERT logic (see allocatePendingSegment in IndexerSQLMetadataStorageCoordinator). There isn't much point in running concurrent allocations for the same datasource anyway, and the contention causes retries which add delay due to sleeps. It might work better to synchronize allocations on a per-datasource basis, so only one can happen at a time per datasource.
Today, when SegmentAllocateAction is run by multiple threads at once, it can end up doing a lot of internal retries due to its SELECT -> INSERT logic (see
allocatePendingSegmentin IndexerSQLMetadataStorageCoordinator). There isn't much point in running concurrent allocations for the same datasource anyway, and the contention causes retries which add delay due to sleeps. It might work better to synchronize allocations on a per-datasource basis, so only one can happen at a time per datasource.