Skip to content

Commit

Permalink
Fixed off-by-one error in aborted txn check
Browse files Browse the repository at this point in the history
  • Loading branch information
mhowlett authored and edenhill committed Aug 30, 2019
1 parent 941e049 commit 35d0913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rdkafka_msgset_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,14 +820,14 @@ rd_kafka_msgset_reader_msg_v2 (rd_kafka_msgset_reader_t *msetr) {
if (unlikely(aborted_txn_start_offset == -1))
goto unexpected_abort_txn;

if (unlikely(aborted_txn_start_offset >= hdr.Offset))
if (unlikely(aborted_txn_start_offset > hdr.Offset))
rd_rkb_log(msetr->msetr_rkb, LOG_ERR, "TXN",
"%s [%"PRId32"]: "
"Abort txn ctrl msg bad order "
"at offset %"PRId64". Expected "
"before or at %"PRId64". Messages "
"in aborted transactions may be "
" delivered to the application",
"delivered to the application",
rktp->rktp_rkt->rkt_topic->str,
rktp->rktp_partition,
hdr.Offset, aborted_txn_start_offset);
Expand Down

0 comments on commit 35d0913

Please sign in to comment.