-
Notifications
You must be signed in to change notification settings - Fork 82
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 lock/unlock codes for kvstore #43
Conversation
Signed-off-by: Jonghyun Lee <albam.c@navercorp.com>
Codecov Report@@ Coverage Diff @@
## master #43 +/- ##
=======================================
Coverage 96.93% 96.93%
=======================================
Files 13 13
Lines 196 196
=======================================
Hits 190 190
Misses 4 4
Partials 2 2 Continue to review full report at Codecov.
|
Signed-off-by: Jonghyun Lee <albam.c@navercorp.com>
Signed-off-by: Jonghyun Lee <albam.c@navercorp.com>
Hey - thanks for this PR! Do I understand it correctly that its purpose is to synchronize KV store access when multiple GORBs use it to avoid reading some sort of invalid data? In this case, what sort of race conditions or data corruption you envision if using KV store without locking? Regarding the logging levels – yeah, if not configured explicitly, all packages will end up using a global Logger object, so updating a setting in one place should affect it everywhere else. I'm not sure why this is not the behavior you're experiencing – I'll investigate! Also, some basic tests would be nice to have before landing this PR =) |
Umm... I think if multiple gorb access kvstore, each gorb should access different kvstore path. |
Oh, so you mean this is for cases when there's a separate service somewhere that might modify parts of KV store that are also accessed by a Gorb instance and in this case there might be a data race? I haven't really thought about this usecase – the mental model is for all LB topology changes to go through the Gorb API. Are you saying that you have an internal service that utilizes this direct KV store modifications to control weights? |
Sorry for late answer.
|
Yeah, I still don't see how this fixes anything but I see how this could promote the usecase where a 3rd-party app or service is fiddling with Gorb's KV namespace, which I don't think is a good thing. So I'm gonna close it. |
What I did
Add a lock/unlock codes for kvstore
How I did
How to test it
What to do
references
https://github.com/docker/libkv/blob/master/docs/examples.md