-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add cets:insert_serial/2 #33
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
=======================================
Coverage 97.38% 97.38%
=======================================
Files 9 9
Lines 612 613 +1
=======================================
+ Hits 596 597 +1
Misses 16 16
☔ View full report in Codecov by Sentry. |
@chrzaszcz Propose better name for insert_serial, if you want. insert_serialized? upsert_though_the_main_node? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments.
It is a reverted change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
All `insert_serial' calls are sent to the leader node first.
Similar to
insert_new/2
, but overwrites the data silently on conflict.It could be used to update entries, which use not node-specific keys.
This function ensures that all nodes would agree on the value, if they try to insert (OR overwrite) a record with the same key at once.
It is used by esl/MongooseIM#4136