[DDC-2340] Fix bug with dirty collection matching + ordering.
Merge branch 'DDC-2340' into 2.3