Skip to content

Commit

Permalink
[OTE-846] Bazooka sequential clear (backport #2423) (#2477)
Browse files Browse the repository at this point in the history
Co-authored-by: jerryfan01234 <[email protected]>
  • Loading branch information
mergify[bot] and jerryfan01234 authored Oct 7, 2024
1 parent 6800a36 commit 4b19a59
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 @@ -264,14 +264,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 4b19a59

Please sign in to comment.