Skip to content

fix: add search params validation that from <= to#442

Open
cheb0 wants to merge 1 commit into
mainfrom
0-validate-from-after-to
Open

fix: add search params validation that from <= to#442
cheb0 wants to merge 1 commit into
mainfrom
0-validate-from-after-to

Conversation

@cheb0

@cheb0 cheb0 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Description

otherwise we can get a panic on histogram query (negative array size)

{"level":"error","ts":"2026-06-16T08:39:38.829Z","message":"runtime error: makeslice: len out of range"}
goroutine 99941390 [running]:
runtime/debug.Stack()
    runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
    runtime/debug/stack.go:18 +0x13
github.com/ozontech/seq-db/util.Recover({0x17fc448?, 0xc000374d20?}, {0x17e4380, 0x17dee00})
    github.com/ozontech/seq-db/util/err.go:27 +0x65
github.com/ozontech/seq-db/util.RecoverToError({0x13e1d40?, 0x17dee00?}, {0x17fc448, 0xc000374d20})
    github.com/ozontech/seq-db/util/err.go:33 +0x4f
github.com/ozontech/seq-db/fracmanager.(*Searcher).fracSearch.func1()
    github.com/ozontech/seq-db/fracmanager/searcher.go:248 +0x4d
panic({0x13e1d40?, 0x17dee00?})
    runtime/panic.go:783 +0x132
github.com/ozontech/seq-db/frac/processor.iterateEvalTree({0x17f7998, 0xc3f7801220}, {0xc6863eaa20, {0x2165a20, 0x0, 0x0}, 0x1, 0x18b983022ecb7200, 0x18b9830081e13300, {0x0, ...}, ...}, ...)
    github.com/ozontech/seq-db/frac/processor/search.go:189 +0x14a
github.com/ozontech/seq-db/frac/processor.IndexSearch({0x17f7998, 0xc3f7801220}, {0xc6863eaa20, {0x2165a20, 0x0, 0x0}, 0x1, 0x18b983022ecb7200, 0x18b9830081e13300, {0x0, ...}, ...}, ...)
    github.com/ozontech/seq-db/frac/processor/search.go:111 +0x6df
github.com/ozontech/seq-db/frac.(*sealedDataProvider).Search(0xcbb46b70e0, {0xc6863eaa20, {0x2165a20, 0x0, 0x0}, 0x1, 0x18b983022ecb7200, 0x18b9830081e13300, {0x0, 0x0}, ...})
    github.com/ozontech/seq-db/frac/sealed_index.go:125 +0x392
github.com/ozontech/seq-db/frac.(*Sealed).Search(0xd34b2a5360?, {0x17f7998?, 0xc3f7801220?}, {0xc6863eaa20, {0x2165a20, 0x0, 0x0}, 0x1, 0x18b983022ecb7200, 0x18b9830081e13300, ...})
    github.com/ozontech/seq-db/frac/sealed.go:483 +0xb8
github.com/ozontech/seq-db/fracmanager.(*fractionProxy).Search(0x3?, {0x17f7998?, 0xc3f7801220?}, {0xc6863eaa20, {0x2165a20, 0x0, 0x0}, 0x1, 0x18b983022ecb7200, 0x18b9830081e13300, ...})
    github.com/ozontech/seq-db/fracmanager/proxy_frac.go:70 +0x115
github.com/ozontech/seq-db/fracmanager.(*Searcher).fracSearch(0xdc97277f5e?, {0x17f7998?, 0xc3f7801220?}, {0xc6863eaa20, {0x2165a20, 0x0, 0x0}, 0x1, 0x18b983022ecb7200, 0x18b9830081e13300, ...}, ...)
    github.com/ozontech/seq-db/fracmanager/searcher.go:252 +0xd6
github.com/ozontech/seq-db/fracmanager.(*Searcher).searchDocsAsync.func2()
    github.com/ozontech/seq-db/fracmanager/searcher.go:210 +0x17c
created by github.com/ozontech/seq-db/fracmanager.(*Searcher).searchDocsAsync in goroutine 99941381
    github.com/ozontech/seq-db/fracmanager/searcher.go:207 +0x295

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.83%. Comparing base (23d27e1) to head (648db5f).

Files with missing lines Patch % Lines
proxyapi/grpc_v1.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #442   +/-   ##
=======================================
  Coverage   70.83%   70.83%           
=======================================
  Files         225      225           
  Lines       17512    17514    +2     
=======================================
+ Hits        12404    12406    +2     
  Misses       4183     4183           
  Partials      925      925           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eguguchkin eguguchkin requested a review from moflotas June 17, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants