[#1298] writecache: Add shrink flag for Seal command

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-08-06 15:45:53 +03:00
parent 5c01bd5be8
commit 36efccd862
12 changed files with 255 additions and 187 deletions

View file

@ -61,6 +61,7 @@ func (s *Shard) FlushWriteCache(ctx context.Context, p FlushWriteCachePrm) error
type SealWriteCachePrm struct {
IgnoreErrors bool
RestoreMode bool
Shrink bool
}
// SealWriteCache flushes all data from the write-cache and moves it to degraded read only mode.
@ -87,5 +88,5 @@ func (s *Shard) SealWriteCache(ctx context.Context, p SealWriteCachePrm) error {
return ErrDegradedMode
}
return s.writeCache.Seal(ctx, writecache.SealPrm{IgnoreErrors: p.IgnoreErrors, RestoreMode: p.RestoreMode})
return s.writeCache.Seal(ctx, writecache.SealPrm{IgnoreErrors: p.IgnoreErrors, RestoreMode: p.RestoreMode, Shrink: p.Shrink})
}