From 46f92013d2aabb8e7c69be2b74a281cc28a309d3 Mon Sep 17 00:00:00 2001 From: hoseinaghaei Date: Thu, 15 Feb 2024 14:00:24 +0330 Subject: [PATCH] fix. --- kafka_server/broker/file/write.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka_server/broker/file/write.py b/kafka_server/broker/file/write.py index 2334d80..e33c263 100644 --- a/kafka_server/broker/file/write.py +++ b/kafka_server/broker/file/write.py @@ -32,7 +32,7 @@ def write_data(self, key: str, value: str): with self._write_lock: md5 = hash_md5(key) partition_count = get_partition_count() - if int(md5, 16) % partition_count != (int(self.partition) - 1 % partition_count): + if int(md5, 16) % partition_count != ((int(self.partition) - 1) % partition_count): raise Exception(f"key is not for this partition, fuck {md5} {key} {partition_count}") appended = self.segment.append(key, value)