Server panic: empty chunk returned from ChunkStore
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 120
Description
This happens rarely but I've seen it twice now over the past couple days.
Platform: WSL
Version: 1.49.3
Stack trace:
```
panic: assertion failed: empty chunk returned from ChunkStore
goroutine 321 [running]:
github.com/dolthub/dolt/go/store/prolly/tree.assertTrue(...)
github.com/dolthub/dolt/go/store/prolly/tree/node_cursor.go:634
github.com/dolthub/dolt/go/store/prolly/tree.nodeStore.Read({{0x38af5e8, 0xc000130030}, {{0xc001bbcf90, 0xc001bbcff0, 0xc001bbd050, 0xc001bbd0b0, 0xc001bbd110, 0xc001bbd170, 0xc001bbd1d0, 0xc001bbd230, ...}}, ...}, ...)
github.com/dolthub/dolt/go/store/prolly/tree/node_store.go:100 +0x5f9
github.com/dolthub/dolt/go/store/prolly/tree.fetchChild(...)
github.com/dolthub/dolt/go/store/prolly/tree/node_cursor.go:629
github.com/dolthub/dolt/go/store/prolly/tree.(*cursor).fetchNode(...)
github.com/dolthub/dolt/go/store/prolly/tree/node_cursor.go:560
github.com/dolthub/dolt/go/store/prolly/tree.(*cursor).advance(0xc0018de180, {0x3815028, 0xc034953c20})
github.com/dolthub/dolt/go/store/prolly/tree/node_cursor.go:512 +0x165
github.com/dolthub/dolt/go/store/prolly/tree.(*cursor).advance(0xc0018de200, {0x3815028, 0xc034953c20})
github.com/dolthub/dolt/go/store/prolly/tree/node_cursor.go:500 +0x76
github.com/dolthub/dolt/go/store/prolly/tree.(*cursor).advance(0xc0018de280, {0x3815028, 0xc034953c20})
github.com/dolthub/dolt/go/store/prolly/tree/node_cursor.go:500 +0x76
github.com/dolthub/dolt/go/store/prolly/tree.(*OrderedTreeIter[...]).Next(0xc039860790, {0x3815028?, 0xc034953c20})
github.com/dolthub/dolt/go/store/prolly/tree/map.go:579 +0x183
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro.createNewStatsBuckets(0xc034953c20, {0x3824910, 0xc034965110}, 0xc0396df220, {0xc0396df340, 0x2, 0x1?}, {0xc04281dba0, 0x2, 0x2})
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro/update.go:126 +0x1c67
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro.(*Provider).checkRefresh(0xc01691a320, 0xc034953c20, {0x380eea0, 0xc033a95380}, {0xc00212e9f0, 0xf}, {0xc039710aab, 0x4}, 0x3fe0000000000000)
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro/auto_refresh.go:247 +0xe25
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro.(*Provider).InitAutoRefreshWithParams.func1({0x3814d10, 0xc0022a9ef0})
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro/auto_refresh.go:98 +0xe74
github.com/dolthub/go-mysql-server/sql.(*BackgroundThreads).Add.func1()
github.com/dolthub/go-mysql-server@v0.19.1-0.20250221004930-c799663bc359/sql/background_threads.go:67 +0x55
created by github.com/dolthub/go-mysql-server/sql.(*BackgroundThreads).Add in goroutine 356
github.com/dolthub/go-mysql-server@v0.19.1-0.20250221004930-c799663bc359/sql/background_threads.go:65 +0x1fc
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the assertion at go/store/prolly/tree/node_cursor.go:634 and the read path in node_store.go:100, then follow the stats refresh callers in go/libraries/doltcore/sqle/statspro/update.go and auto_refresh.go. Reproduce the WSL panic if possible and identify why an empty chunk reaches ChunkStore; done means the failure is understood and covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100