Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 9da7483

Browse files
tomwilkiegouthamve
authored andcommitted
Don't write empty values to the index. (cortexproject#2557)
This causes tombstones to be written to Cassandra, which causes excessive heap usage.: Signed-off-by: Tom Wilkie <[email protected]>
1 parent 6d72700 commit 9da7483

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/chunk/schema.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const (
3636
var (
3737
// ErrNotSupported when a schema doesn't support that particular lookup.
3838
ErrNotSupported = errors.New("not supported")
39+
empty = []byte("-")
3940
)
4041

4142
type hasChunksForIntervalFunc func(userID, seriesID string, from, through model.Time) (bool, error)
@@ -699,6 +700,7 @@ func (v9Entries) GetLabelWriteEntries(bucket Bucket, metricName string, labels l
699700
TableName: bucket.tableName,
700701
HashValue: bucket.hashKey + ":" + metricName,
701702
RangeValue: encodeRangeKey(seriesRangeKeyV1, seriesID, nil, nil),
703+
Value: empty,
702704
},
703705
}
704706

@@ -806,6 +808,7 @@ func (s v10Entries) GetLabelWriteEntries(bucket Bucket, metricName string, label
806808
TableName: bucket.tableName,
807809
HashValue: fmt.Sprintf("%02d:%s:%s", shard, bucket.hashKey, metricName),
808810
RangeValue: encodeRangeKey(seriesRangeKeyV1, seriesID, nil, nil),
811+
Value: empty,
809812
},
810813
}
811814

@@ -837,6 +840,7 @@ func (v10Entries) GetChunkWriteEntries(bucket Bucket, metricName string, labels
837840
TableName: bucket.tableName,
838841
HashValue: bucket.hashKey + ":" + string(seriesID),
839842
RangeValue: encodeRangeKey(chunkTimeRangeKeyV3, encodedThroughBytes, nil, []byte(chunkID)),
843+
Value: empty,
840844
},
841845
}
842846

@@ -949,6 +953,7 @@ func (s v11Entries) GetLabelWriteEntries(bucket Bucket, metricName string, label
949953
TableName: bucket.tableName,
950954
HashValue: fmt.Sprintf("%02d:%s:%s", shard, bucket.hashKey, metricName),
951955
RangeValue: encodeRangeKey(seriesRangeKeyV1, seriesID, nil, nil),
956+
Value: empty,
952957
},
953958
// Entry for seriesID -> label names
954959
{

0 commit comments

Comments
 (0)