influxdata / influxdata/influxdb

Don't increase cache size when write failed

Open
#23,759 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

https://github.com/influxdata/influxdb/blob/43c2e08cf54b27bc2aa1a064a898ccb8464731ce/tsdb/engine/tsm1/cache.go#L342-L354

I notice in TestCache_CacheWriteMulti_TypeConflict test, we assume cache size won't increase when writing failed, but actually, it adds key size, I think this may be a bug. So this test cannot pass

https://github.com/influxdata/influxdb/blob/43c2e08cf54b27bc2aa1a064a898ccb8464731ce/tsdb/engine/tsm1/cache_test.go#L110-L116

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tsdb/engine/tsm1/cache.go at lines 342-354 and the failing scenario in tsdb/engine/tsm1/cache_test.go at lines 110-116, especially TestCache_CacheWriteMulti_TypeConflict. Run that focused test first, then trace the failed write and cache-size accounting. Done means the test passes and a failed write no longer increases the cache size.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.