Skip to content

Provide better collision safety for SYNCHRONIZED_SEQUENCE #894

Description

@duro1

Looking to provide better collision avoidance when using the sequence number on distributed machines.

With SYNCHRONIZED_SEQUENCE marked as not safe for distributed, RANDOM generator marked as deprecated, and CUSTOM only able to compare based on timestamp, it is difficult to ensure proper ordering of events with distributed systems if there is any time drift.

providing a secondary comparator criteria allows for reasonable expectations of both ordering and collision avoidance for a smaller number of distributed systems connected to the same JaVers repository. This is not a foolproof solution, but better than what is currently available

Activity

  1. bartoszwalacik commented on Oct 10, 2019

    @bartoszwalacik
    Member

    thanks, I will manage your contribution in the next week

  2. bartoszwalacik commented on Oct 22, 2019

    @bartoszwalacik
    Member

    Well, RANDOM generator isn't deprecated, it's recommended if you have more than one instance of your app writing to the same Javers repository.
    Yet, if you prefer to stay with SYNCHRONIZED_SEQUENCE, you can get better sorting, which is as I understand the subject of this issue. Give me a while to check your PR.

  3. bartoszwalacik commented on Oct 23, 2019

    @bartoszwalacik
    Member

    Fixed in 5.8.2, @duro1 thanks for your PR contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions