hazelcast/hazelcast — pull request #4275 by jerrinot (2014-12-10 12:06:37+00:00)
Title: #3796 - Transactional queue no longer loses messages during migration

When a partition is promoted from a backup to a primary then QueueContainer iterates through collection of existing backup values and set its own IDGenerator to the highest itemID found in backups.

However chances are the backup collection doesn't contain all records created by the old primary as some backup operations can still be in-flight. This leads to duplicated IDs generated by the new primary.

This fix simple adds an offset so the new owner always generates IDs significantly higher then the previous owner. The down-side is the generated ID are no longer continuous, but I don't see this as a problem.