Skip to content

Commit

Permalink
[OTE-846] Bazooka sequential clear (#2423)
Browse files Browse the repository at this point in the history
(cherry picked from commit b57eb4c)
  • Loading branch information
jerryfan01234 authored and mergify[bot] committed Oct 7, 2024
1 parent aad2a2a commit 202f617
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions indexer/services/bazooka/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,17 @@ async function partitionKafkaTopics(): Promise<void> {
async function clearKafkaTopics(
existingKafkaTopics: string[],
): Promise<void> {
await Promise.all(
_.map(KAFKA_TOPICS,
clearKafkaTopic.bind(null,
1,
config.CLEAR_KAFKA_TOPIC_RETRY_MS,
config.CLEAR_KAFKA_TOPIC_MAX_RETRIES,
existingKafkaTopics)),
);
// Concurrent calls to clear all topics caused the failure:
// TypeError: Cannot destructure property 'partitions' of 'high.pop(...)' as it is undefined.
for (const topic of KAFKA_TOPICS) {
await clearKafkaTopic(
1,
config.CLEAR_KAFKA_TOPIC_RETRY_MS,
config.CLEAR_KAFKA_TOPIC_MAX_RETRIES,
existingKafkaTopics,
topic,
);
}
}

export async function clearKafkaTopic(
Expand Down

0 comments on commit 202f617

Please sign in to comment.