Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better collision safety for SYNCHRONIZED_SEQUENCE #894

Closed
duro1 opened this issue Oct 9, 2019 · 3 comments
Closed

Provide better collision safety for SYNCHRONIZED_SEQUENCE #894

duro1 opened this issue Oct 9, 2019 · 3 comments
Labels

Comments

@duro1
Copy link
Contributor

@duro1 duro1 commented Oct 9, 2019

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

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Oct 10, 2019

thanks, I will manage your contribution in the next week

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Oct 22, 2019

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.

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Oct 23, 2019

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
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants