Skip to content

Commit

Permalink
fix ooo blocks shipping
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Jun 20, 2023
1 parent b98dee6 commit 64ff843
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,7 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
if maxExemplarsForUser > 0 {
enableExemplars = true
}
oooTimeWindow := time.Duration(i.limits.OutOfOrderTimeWindow(userID)).Milliseconds()
// Create a new user database
db, err := tsdb.Open(udir, userLogger, tsdbPromReg, &tsdb.Options{
RetentionDuration: i.cfg.BlocksStorageConfig.TSDB.Retention.Milliseconds(),
Expand All @@ -1975,7 +1976,7 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
MaxExemplars: maxExemplarsForUser,
HeadChunksWriteQueueSize: i.cfg.BlocksStorageConfig.TSDB.HeadChunksWriteQueueSize,
EnableMemorySnapshotOnShutdown: i.cfg.BlocksStorageConfig.TSDB.MemorySnapshotOnShutdown,
OutOfOrderTimeWindow: time.Duration(i.limits.OutOfOrderTimeWindow(userID)).Milliseconds(),
OutOfOrderTimeWindow: oooTimeWindow,
OutOfOrderCapMax: i.cfg.BlocksStorageConfig.TSDB.OutOfOrderCapMax,
}, nil)
if err != nil {
Expand Down Expand Up @@ -2028,8 +2029,8 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
bucket.NewUserBucketClient(userID, i.TSDBState.bucket, i.limits),
func() labels.Labels { return l },
metadata.ReceiveSource,
false, // No need to upload compacted blocks. Cortex compactor takes care of that.
true, // Allow out of order uploads. It's fine in Cortex's context.
oooTimeWindow > 0, // No need to upload compacted blocks unless out of order samples is enabled.
true, // Allow out of order uploads. It's fine in Cortex's context.
metadata.NoneFunc,
)

Expand Down

0 comments on commit 64ff843

Please sign in to comment.