Skip to content

Commit

Permalink
do not write buckets on disk if limit set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
hrissan committed Aug 17, 2023
1 parent 9f1ee96 commit 850fa9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/agent/agent_shard_send.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,12 @@ func (s *ShardReplica) diskCachePutWithLog(cbd compressedBucketData) {
if s.agent.diskCache == nil {
return
}
s.mu.Lock()
maxHistoricDiskSize := s.config.MaxHistoricDiskSize
s.mu.Unlock()
if maxHistoricDiskSize <= 0 {
return
}
if err := s.agent.diskCache.PutBucket(s.ShardReplicaNum, cbd.time, cbd.data); err != nil {
s.client.Client.Logf("Disk Error: diskCache.PutBucket returned error %v for shard %d replica %d (shard-replica %d) bucket %d",
err, s.ShardKey, s.ReplicaKey, s.ShardReplicaNum, cbd.time)
Expand Down

0 comments on commit 850fa9c

Please sign in to comment.