Skip to content

Commit 3a2f3da

Browse files
committed
Adding the userId on the compact dir path
1 parent 09f593c commit 3a2f3da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/compactor/compactor.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"hash/fnv"
88
"math/rand"
99
"os"
10-
"path"
1110
"path/filepath"
1211
"strings"
1312
"time"
@@ -832,7 +831,7 @@ func (c *Compactor) compactUser(ctx context.Context, userID string) error {
832831
c.blocksGrouperFactory(currentCtx, c.compactorCfg, bucket, ulogger, reg, c.blocksMarkedForDeletion, c.blocksMarkedForNoCompaction, c.garbageCollectedBlocks, c.remainingPlannedCompactions, c.blockVisitMarkerReadFailed, c.blockVisitMarkerWriteFailed, c.ring, c.ringLifecycler, c.limits, userID, noCompactMarkerFilter),
833832
c.blocksPlannerFactory(currentCtx, bucket, ulogger, c.compactorCfg, noCompactMarkerFilter, c.ringLifecycler, c.blockVisitMarkerReadFailed, c.blockVisitMarkerWriteFailed),
834833
c.blocksCompactor,
835-
path.Join(c.compactorCfg.DataDir, "compact"),
834+
c.compactDirForUser(userID),
836835
bucket,
837836
c.compactorCfg.CompactionConcurrency,
838837
c.compactorCfg.SkipBlocksWithOutOfOrderChunksEnabled,
@@ -941,6 +940,11 @@ func (c *Compactor) metaSyncDirForUser(userID string) string {
941940
return filepath.Join(c.compactorCfg.DataDir, compactorMetaPrefix+userID)
942941
}
943942

943+
// compactDirForUser returns the directory to be used to download and compact the blocks date for a user
944+
func (c *Compactor) compactDirForUser(userID string) string {
945+
return filepath.Join(c.compactorCfg.DataDir, "compact", userID)
946+
}
947+
944948
// This function returns tenants with meta sync directories found on local disk. On error, it returns nil map.
945949
func (c *Compactor) listTenantsWithMetaSyncDirectories() map[string]struct{} {
946950
result := map[string]struct{}{}

0 commit comments

Comments
 (0)