#26588·hazelcast

Transactional IMap mutations do not preserve insertion order [INBOX-1175]

Author: timothywongCreated May 18, 2026Updated Jul 23, 2026
LabelsType: DefectType: EnhancementSource: CommunityModule: Transactions

Description

Hazelcast does not preserve the insertion order of mutations within a transaction that target the same partition.

This may be related to an internal optimization in Hazelcast 4.x where transaction tracking changed from a linked structure to HashMap, which does not preserve insertion order.

Expected behavior

Mutations in a single transaction that map to the same partition should be committed in the same order they were added to the transaction.

Use Case / Context:

In financial systems (such as processing FIX execution reports), multiple sequential messages regarding the same financial instrument or order may be committed within a single transaction. Each FIX report may have a unique map key but share the same partition key (for example, Symbol or Order ID). In this scenario, the relative order of those mutations must be preserved to maintain correct downstream state.

If transaction commit processing does not preserve insertion order, later messages can overtake earlier ones and result in incorrect downstream event handling or corrupt state.

Steps to reproduce the behavior

  1. Run TransactionOrderTest.java
  2. Observe that the assertions expecting strict insertion order fail.

TransactionOrderTest.java

Additional context

I was able to reproduce the issue with the attached test case TransactionOrderTest.java. Replacing the HashMap with a LinkedHashMap in TransactionLog.java appears to preserve order and makes the test pass.