kafka: fix endless loop when fetch message from empty topic partition

This commit is contained in:
wzl12356
2022-03-18 19:32:29 +08:00
parent 3b3d9ae073
commit fc28fddba8
+1 -1
View File
@@ -516,7 +516,7 @@ bool __ComplexKafkaTask::process_fetch()
while ((toppar = this->get_resp()->get_toppar_list()->get_next()) != NULL)
{
if (toppar->get_error() == KAFKA_OFFSET_OUT_OF_RANGE &&
toppar->get_offset() >= 0)
toppar->get_high_watermark() - toppar->get_low_watermark() > 0)
{
toppar->set_offset(KAFKA_OFFSET_OVERFLOW);
toppar->set_low_watermark(KAFKA_OFFSET_UNINIT);