Skip to content

fix: correctly handle non-existing ids#458

Merged
dkharms merged 1 commit into
mainfrom
0-fix-oob
Jul 13, 2026
Merged

fix: correctly handle non-existing ids#458
dkharms merged 1 commit into
mainfrom
0-fix-oob

Conversation

@dkharms

@dkharms dkharms commented Jul 7, 2026

Copy link
Copy Markdown
Member

Description

Rarely we encountered panics (out of bounds access) and I decided to shove the stacktrace into Fable and observe how it will handle the bug. Well, it found the root-cause.

{"level":"error","ts":"2026-07-07T14:13:34.054Z","message":"runtime error: index out of range [1508] with length 1508"}
goroutine 13507559 [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({0x192a3a0?, 0xc00063af00?}, {0x729e409aa098, 0xc1e0afbae8})
    github.com/ozontech/seq-db/util/err.go:27 +0x65
github.com/ozontech/seq-db/util.RecoverToError({0x1634bc0?, 0xc1e0afbae8?}, {0x192a3a0, 0xc00063af00})
    github.com/ozontech/seq-db/util/err.go:33 +0x4f
github.com/ozontech/seq-db/fracmanager.fracFetch.func1()
    github.com/ozontech/seq-db/fracmanager/fetcher.go:110 +0x4d
panic({0x1634bc0?, 0xc1e0afbae8?})
    runtime/panic.go:783 +0x132
github.com/ozontech/seq-db/frac/sealed/seqids.(*unpackCache).GetValByLID(...)
    github.com/ozontech/seq-db/frac/sealed/seqids/unpack_cache.go:47
github.com/ozontech/seq-db/frac/sealed/seqids.(*Provider).MID(0xc100e98550, 0xf15e4)
    github.com/ozontech/seq-db/frac/sealed/seqids/provider.go:54 +0x71
github.com/ozontech/seq-db/frac.(*sealedIDsIndex).GetMID(0xc0f764d0a0, 0xf15e4)
    github.com/ozontech/seq-db/frac/sealed_index.go:148 +0x35
github.com/ozontech/seq-db/frac.(*sealedFetchIndex).findLIDs(0xc100e985f0, {0xc1dad45630, 0x1, 0xc016b9d500?})
    github.com/ozontech/seq-db/frac/sealed_index.go:360 +0x13b
github.com/ozontech/seq-db/frac.(*sealedFetchIndex).GetDocPos(0xc100e985f0, {0xc1dad45630?, 0xc?, 0x1?}, 0x0)
    github.com/ozontech/seq-db/frac/sealed_index.go:302 +0x26
github.com/ozontech/seq-db/frac/processor.IndexFetch({0xc1dad45630, 0x1, 0x1}, 0x0, 0xc0f764d080, {0x19242a0, 0xc100e985f0}, {0xc58016d668, 0x1, 0x1})
    github.com/ozontech/seq-db/frac/processor/fetch.go:16 +0xa6
github.com/ozontech/seq-db/frac.(*sealedDataProvider).Fetch(0xc486c761b0, {0xc1dad45630, 0x1, 0x1}, 0x0)
    github.com/ozontech/seq-db/frac/sealed_index.go:105 +0x2b2
github.com/ozontech/seq-db/frac.(*Sealed).Fetch(0x108e57c?, {0x1925690?, 0xc0b6564230?}, {0xc1dad45630, 0x1, 0x1}, 0x0)
    github.com/ozontech/seq-db/frac/sealed.go:477 +0xad
github.com/ozontech/seq-db/fracmanager.fracFetch({0x1925690?, 0xc0b6564230?}, {0x192a088?, 0xc3533a2c30?}, {0xc1dad45630?, 0xc140d549a0?, 0x3e8?}, 0x70?)
    github.com/ozontech/seq-db/fracmanager/fetcher.go:114 +0xb6
github.com/ozontech/seq-db/fracmanager.(*Fetcher).fetchDocsAsync.func2()
    github.com/ozontech/seq-db/fracmanager/fetcher.go:87 +0xb8
created by github.com/ozontech/seq-db/fracmanager.(*Fetcher).fetchDocsAsync in goroutine 13507558
    github.com/ozontech/seq-db/fracmanager/fetcher.go:85 +0x1da
{"level":"error","ts":"2026-07-07T14:13:34.055Z","message":"fetch error","error":"internal error: fetch panicked on fraction seq-db-01KWYD9DBNAYK3Y859ZGRCC8A4, error=runtime error: index out of range [1508] with length 1508"}

  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

If you have used LLM/AI assistance please provide model name and full prompt:

Model: Fable 5
Prompt: Asked to debug the panic

@dkharms dkharms added the bug Something isn't working label Jul 7, 2026
@codecov-commenter

codecov-commenter commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.22%. Comparing base (886c9bd) to head (1af2d99).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #458      +/-   ##
==========================================
- Coverage   70.38%   70.22%   -0.17%     
==========================================
  Files         232      232              
  Lines       18343    18343              
==========================================
- Hits        12911    12881      -30     
- Misses       4466     4486      +20     
- Partials      966      976      +10     

☔ 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 added this to the v0.74.0 milestone Jul 13, 2026
@dkharms dkharms merged commit 00ce775 into main Jul 13, 2026
8 checks passed
@dkharms dkharms deleted the 0-fix-oob branch July 13, 2026 11:09
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

Successfully merging this pull request may close these issues.

4 participants