-
Notifications
You must be signed in to change notification settings - Fork 78
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
[patch] fix duplicated search result #729
Conversation
[CHATOPS:HELP] ChatOps commands.
|
Best reviewed: commit by commit
Optimal code review plan
|
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
5aae231
to
0c72ab7
Compare
Codecov Report
@@ Coverage Diff @@
## master #729 +/- ##
==========================================
+ Coverage 14.31% 14.32% +0.01%
==========================================
Files 419 419
Lines 19420 19420
==========================================
+ Hits 2780 2782 +2
+ Misses 16406 16403 -3
- Partials 234 235 +1
Continue to review full report at Codecov.
|
@@ -161,15 +161,13 @@ func (s *server) search(ctx context.Context, cfg *payload.Search_Config, | |||
return nil | |||
} | |||
id := dist.GetId() | |||
mu.RLock() | |||
mu.Lock() |
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'm not sure but how about to use sync.Map as visited
?
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.
we already tried sync.Map implementation, at https://github.com/vdaas/vald/pull/729/files#diff-320187c6fd3d930cdcd5999eb7192ed5R150 and https://github.com/vdaas/vald/pull/729/files#diff-320187c6fd3d930cdcd5999eb7192ed5R172-R175
if we change this logic to sync.Map we have to re-check accuracy.
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 think if we change mutex to lockfree we should make another PR, this PR is for current bug fix.
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.
aha, i see.
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.
But I wanted to use sync.Map for this block, I'll make proposal PR for it.
/approve |
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.
[APPROVED] This PR is approved by rinx.
Signed-off-by: kpango i.can.feel.gravity@gmail.com
Description:
fix duplicated search result
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: