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

panic("score should be the same") #860

Open
cd0304 opened this issue Sep 25, 2024 · 2 comments
Open

panic("score should be the same") #860

cd0304 opened this issue Sep 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cd0304
Copy link

cd0304 commented Sep 25, 2024

Please answer these questions before submitting your issue. Thanks!

Gorse version
Version: unknown-version
API version: v0.2.7
Go version: go1.23.1
Git commit: unknown-commit
Built: unknown-buildtime
OS/Arch: windows/amd64

Describe the bug
When it is first started, MySQL stores the data_cache, records the user, item, and feedback, and after starting, it is found that the master calculates the score and writes it to the cache database, and then after the worker gets up, when the score is calculated and written to the cache database, it will judge that the score of the data is inconsistent, resulting in panic,
Why this is the case is a question that must arise

The location of the code where the error occurred
func (aggregator *DocumentAggregator) Add(category string, values []string, scores []float64) {
for i, value := range values {
if _, ok := aggregator.Documents[value]; !ok {
aggregator.Documents[value] = &Document{
Id: value,
Score: scores[i],
Categories: []string{category},
Timestamp: aggregator.Timestamp,
}
} else {
if aggregator.Documents[value].Score != scores[i] {
//bug here
panic("score should be the same")
}
aggregator.Documents[value].Categories = append(aggregator.Documents[value].Categories, category)
}
}
}

@cd0304 cd0304 added the bug Something isn't working label Sep 25, 2024
@chengjk
Copy link

chengjk commented Sep 26, 2024

I have the same problem, keep watching.

1 similar comment
@xuzhiqiang0723
Copy link

I have the same problem, keep watching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants