From 7a274bd72fffd5e6f22dc68b813d4e20b9c3d86c Mon Sep 17 00:00:00 2001 From: roy-dydx <133032749+roy-dydx@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:05:50 -0400 Subject: [PATCH] Revert "Fix bug in clearing topics (backport #2202)" (#2210) --- indexer/services/bazooka/src/index.ts | 32 +-------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/indexer/services/bazooka/src/index.ts b/indexer/services/bazooka/src/index.ts index 7ea6a909be..5d78cc85f8 100644 --- a/indexer/services/bazooka/src/index.ts +++ b/indexer/services/bazooka/src/index.ts @@ -232,41 +232,11 @@ async function createKafkaTopics( }); } -<<<<<<< HEAD -======= -async function partitionKafkaTopics(): Promise { - for (const kafkaTopic of KAFKA_TOPICS) { - const topicMetadata: { topics: Array } = await admin.fetchTopicMetadata({ - topics: [kafkaTopic], - }); - if (topicMetadata.topics.length === 1) { - if (topicMetadata.topics[0].partitions.length !== KAFKA_TOPICS_TO_PARTITIONS[kafkaTopic]) { - logger.info({ - at: 'index#partitionKafkaTopics', - message: `Setting topic ${kafkaTopic} to ${KAFKA_TOPICS_TO_PARTITIONS[kafkaTopic]} partitions`, - }); - await admin.createPartitions({ - validateOnly: false, - topicPartitions: [{ - topic: kafkaTopic, - count: KAFKA_TOPICS_TO_PARTITIONS[kafkaTopic], - }], - }); - logger.info({ - at: 'index#partitionKafkaTopics', - message: `Successfully set topic ${kafkaTopic} to ${KAFKA_TOPICS_TO_PARTITIONS[kafkaTopic]} partitions`, - }); - } - } - } -} - ->>>>>>> 0788d298 (Fix bug in clearing topics (#2202)) async function clearKafkaTopics( existingKafkaTopics: string[], ): Promise { await Promise.all( - _.map(KAFKA_TOPICS, + _.map(KAFKA_TOPICS_TO_PARTITIONS, clearKafkaTopic.bind(null, 1, config.CLEAR_KAFKA_TOPIC_RETRY_MS,