@@ -867,7 +867,7 @@ class PartitionRecords(object):
867
867
def __init__ (self , fetch_offset , tp , records ,
868
868
key_deserializer = None , value_deserializer = None ,
869
869
check_crcs = True , isolation_level = READ_UNCOMMITTED ,
870
- aborted_transactions = None , # list of (producer_id, first_offset) tuples
870
+ aborted_transactions = None , # raw data from response / list of (producer_id, first_offset) tuples
871
871
metric_aggregator = None , on_drain = lambda x : None ):
872
872
self .fetch_offset = fetch_offset
873
873
self .topic_partition = tp
@@ -878,7 +878,8 @@ def __init__(self, fetch_offset, tp, records,
878
878
self .isolation_level = isolation_level
879
879
self .aborted_producer_ids = set ()
880
880
self .aborted_transactions = collections .deque (
881
- [AbortedTransaction (* data ) for data in aborted_transactions ] if aborted_transactions else []
881
+ sorted ([AbortedTransaction (* data ) for data in aborted_transactions ] if aborted_transactions else [],
882
+ key = lambda txn : txn .first_offset )
882
883
)
883
884
self .metric_aggregator = metric_aggregator
884
885
self .check_crcs = check_crcs
0 commit comments