@@ -20,13 +20,13 @@ import (
20
20
21
21
"github.com/cortexproject/cortex/pkg/storage/bucket"
22
22
cortex_parquet "github.com/cortexproject/cortex/pkg/storage/parquet"
23
- cortex_tsdb "github.com/cortexproject/cortex/pkg/storage/tsdb"
24
23
"github.com/cortexproject/cortex/pkg/storage/tsdb/bucketindex"
25
- "github.com/cortexproject/cortex/pkg/storage/tsdb/users "
24
+ "github.com/cortexproject/cortex/pkg/tenant "
26
25
"github.com/cortexproject/cortex/pkg/util"
27
26
"github.com/cortexproject/cortex/pkg/util/concurrency"
28
27
util_log "github.com/cortexproject/cortex/pkg/util/log"
29
28
"github.com/cortexproject/cortex/pkg/util/services"
29
+ "github.com/cortexproject/cortex/pkg/util/users"
30
30
)
31
31
32
32
const (
@@ -536,7 +536,7 @@ func (c *BlocksCleaner) deleteUserMarkedForDeletion(ctx context.Context, userLog
536
536
}
537
537
level .Info (userLogger ).Log ("msg" , "completed deleting blocks for tenant marked for deletion" , "duration" , time .Since (begin ), "duration_ms" , time .Since (begin ).Milliseconds ())
538
538
539
- mark , err := cortex_tsdb .ReadTenantDeletionMark (ctx , c .bucketClient , userID )
539
+ mark , err := tenant .ReadTenantDeletionMark (ctx , c .bucketClient , userID , userLogger )
540
540
if err != nil {
541
541
return errors .Wrap (err , "failed to read tenant deletion mark" )
542
542
}
@@ -549,7 +549,7 @@ func (c *BlocksCleaner) deleteUserMarkedForDeletion(ctx context.Context, userLog
549
549
if deletedBlocks .Load () > 0 || mark .FinishedTime == 0 {
550
550
level .Info (userLogger ).Log ("msg" , "updating finished time in tenant deletion mark" )
551
551
mark .FinishedTime = time .Now ().Unix ()
552
- return errors .Wrap (cortex_tsdb .WriteTenantDeletionMark (ctx , c .bucketClient , userID , mark ), "failed to update tenant deletion mark" )
552
+ return errors .Wrap (tenant .WriteTenantDeletionMark (ctx , c .bucketClient , userID , mark ), "failed to update tenant deletion mark" )
553
553
}
554
554
if time .Since (time .Unix (mark .FinishedTime , 0 )) < c .cfg .TenantCleanupDelay {
555
555
return nil
@@ -567,7 +567,7 @@ func (c *BlocksCleaner) deleteUserMarkedForDeletion(ctx context.Context, userLog
567
567
} else if deleted > 0 {
568
568
level .Info (userLogger ).Log ("msg" , "deleted marker files for tenant marked for deletion" , "count" , deleted , "duration" , time .Since (begin ), "duration_ms" , time .Since (begin ).Milliseconds ())
569
569
}
570
- if err := cortex_tsdb .DeleteTenantDeletionMark (ctx , c .bucketClient , userID ); err != nil {
570
+ if err := tenant .DeleteTenantDeletionMark (ctx , c .bucketClient , userID ); err != nil {
571
571
return errors .Wrap (err , "failed to delete tenant deletion mark" )
572
572
}
573
573
return nil
0 commit comments