[#2234] writecache: Fix possible panic in `initFlushMarks`

In case we have many small objects in the write-cache, `indices` should
not be reused between iterations.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/62/head
Evgenii Stratonikov 2023-02-14 09:23:24 +03:00 committed by fyrchik
parent 315141dc2c
commit d1d123d180
2 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ Changelog for FrostFS Node
- Fix `*_req_count` and `*_req_count_success` metric values (#2241)
- Storage ID update by write-cache (#2244)
- `neo-go` client deadlock on subscription restoration (#2244)
- Possible panic during write-cache initialization (#2234)
### Removed
### Updated

View File

@ -46,6 +46,7 @@ func (c *cache) initFlushMarks() {
var batchSize = flushBatchSize
for {
m = m[:0]
indices = indices[:0]
// We put objects in batches of fixed size to not interfere with main put cycle a lot.
_ = c.db.View(func(tx *bbolt.Tx) error {