Fixes duplicate Id on bulkUpdate.

When using the replication algorithm, data changes with updates would cause the server to crash with duplicate id error. This PR fixes this issue.