Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoseinaghaei committed Feb 15, 2024
1 parent d405801 commit 46f9201
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kafka_server/broker/file/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 46f9201

Please sign in to comment.