This fixes two problems in the ReplayOptimizedPostgresPersistor:
The documentation specifies that a default aggregate_id index is automatically added. Unfortunately the implementation was broken.
The index used the hash value of the record keys but did not handle hash collisions at all. So when the hash function collided records could be affected with different keys, causing data corruption.
This PR fixes both issues and (tries to) clean up the code.
This fixes two problems in the
ReplayOptimizedPostgresPersistor
:aggregate_id
index is automatically added. Unfortunately the implementation was broken.hash
value of the record keys but did not handle hash collisions at all. So when the hash function collided records could be affected with different keys, causing data corruption.This PR fixes both issues and (tries to) clean up the code.