ActionQueue#InsertActionSorter fails to generate right order

Description

After migration from 4.2.x to 5.2.9 batching susbsystem stops working we got

Test case
https://github.com/MirekSz/hibernate-HHH-11634
In screenshots you can see what is wrong. In action queue there are 3 elements with the same id (hash = 5167) which generates after all inserting 3 times elements with the same id (with hibernate.order_inserts false it works)

Config:
hibernate.order_inserts true
hibernate.jdbc.batch_size 10

I also try SNAPSHOT VER after but the same error occurs

Environment

Hibernate 5.2.9, PostgreSQL

Assignee

Vlad Mihalcea

Reporter

Mirek Sz

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.2.19
4.3.10

Components

Affects versions

Priority

Critical
Configure