From 42ce0c1d430e116eb4c9081bb0b1d8289c4ad782 Mon Sep 17 00:00:00 2001 From: roy-dydx <133032749+roy-dydx@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:05:52 -0400 Subject: [PATCH] Revert "Fix bug in clearing topics (backport #2202)" (#2209) --- 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 3703fc1853..91d691ecb3 100644 --- a/indexer/services/bazooka/src/index.ts +++ b/indexer/services/bazooka/src/index.ts @@ -234,41 +234,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,