@@ -171,7 +171,8 @@ func TestCompactor_SkipCompactionWhenCmkError(t *testing.T) {
171
171
bucketClient := & bucket.ClientMock {}
172
172
bucketClient .MockIter ("" , []string {userID }, nil )
173
173
bucketClient .MockIter ("__markers__" , []string {}, nil )
174
- bucketClient .MockIter (userID + "/" , []string {}, nil )
174
+ bucketClient .MockIter (userID + "/" , []string {userID + "/01DTVP434PA9VFXSW2JKB3392D" }, nil )
175
+ bucketClient .MockGet (userID + "/01DTVP434PA9VFXSW2JKB3392D/meta.json" , mockBlockMetaJSON ("01DTVP434PA9VFXSW2JKB3392D" ), nil )
175
176
bucketClient .MockIter (userID + "/markers/" , nil , nil )
176
177
bucketClient .MockGet (userID + "/markers/cleaner-visit-marker.json" , "" , nil )
177
178
bucketClient .MockUpload (userID + "/markers/cleaner-visit-marker.json" , nil )
@@ -351,7 +352,7 @@ func TestCompactor_ShouldIncrementCompactionErrorIfFailedToCompactASingleTenant(
351
352
bucketClient := & bucket.ClientMock {}
352
353
bucketClient .MockIter ("" , []string {userID }, nil )
353
354
bucketClient .MockIter ("__markers__" , []string {}, nil )
354
- bucketClient .MockIter (userID + "/" , []string {userID + "/01DTVP434PA9VFXSW2JKB3392D/meta.json" , userID + "/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
355
+ bucketClient .MockIter (userID + "/" , []string {userID + "/01DTVP434PA9VFXSW2JKB3392D" , userID + "/01FN6CDF3PNEWWRY5MPGJPE3EX" , userID + "/01DTVP434PA9VFXSW2JKB3392D /meta.json" , userID + "/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
355
356
bucketClient .MockIter (userID + "/markers/" , nil , nil )
356
357
bucketClient .MockGet (userID + "/markers/cleaner-visit-marker.json" , "" , nil )
357
358
bucketClient .MockUpload (userID + "/markers/cleaner-visit-marker.json" , nil )
@@ -409,7 +410,7 @@ func TestCompactor_ShouldCompactAndRemoveUserFolder(t *testing.T) {
409
410
bucketClient .MockIter ("__markers__" , []string {}, nil )
410
411
bucketClient .MockExists (cortex_tsdb .GetGlobalDeletionMarkPath ("user-1" ), false , nil )
411
412
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-1" ), false , nil )
412
- bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D/meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
413
+ bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D" , "user-1/01DTVP434PA9VFXSW2JKB3392D /meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
413
414
bucketClient .MockIter ("user-1/markers/" , nil , nil )
414
415
bucketClient .MockGet ("user-1/markers/cleaner-visit-marker.json" , "" , nil )
415
416
bucketClient .MockUpload ("user-1/markers/cleaner-visit-marker.json" , nil )
@@ -460,8 +461,8 @@ func TestCompactor_ShouldIterateOverUsersAndRunCompaction(t *testing.T) {
460
461
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-1" ), false , nil )
461
462
bucketClient .MockExists (cortex_tsdb .GetGlobalDeletionMarkPath ("user-2" ), false , nil )
462
463
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-2" ), false , nil )
463
- bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D/meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
464
- bucketClient .MockIter ("user-2/" , []string {"user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ/meta.json" , "user-2/01FN3V83ABR9992RF8WRJZ76ZQ/meta.json" }, nil )
464
+ bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D" , "user-1/01DTVP434PA9VFXSW2JKB3392D /meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
465
+ bucketClient .MockIter ("user-2/" , []string {"user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ" , "user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ /meta.json" , "user-2/01FN3V83ABR9992RF8WRJZ76ZQ/meta.json" }, nil )
465
466
bucketClient .MockIter ("user-1/markers/" , nil , nil )
466
467
bucketClient .MockGet ("user-1/markers/cleaner-visit-marker.json" , "" , nil )
467
468
bucketClient .MockUpload ("user-1/markers/cleaner-visit-marker.json" , nil )
@@ -725,8 +726,8 @@ func TestCompactor_ShouldNotCompactBlocksMarkedForSkipCompact(t *testing.T) {
725
726
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-1" ), false , nil )
726
727
bucketClient .MockExists (cortex_tsdb .GetGlobalDeletionMarkPath ("user-2" ), false , nil )
727
728
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-2" ), false , nil )
728
- bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D/meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
729
- bucketClient .MockIter ("user-2/" , []string {"user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ/meta.json" , "user-2/01FN3V83ABR9992RF8WRJZ76ZQ/meta.json" }, nil )
729
+ bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D" , "user-1/01DTVP434PA9VFXSW2JKB3392D /meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
730
+ bucketClient .MockIter ("user-2/" , []string {"user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ" , "user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ /meta.json" , "user-2/01FN3V83ABR9992RF8WRJZ76ZQ/meta.json" }, nil )
730
731
bucketClient .MockIter ("user-1/markers/" , nil , nil )
731
732
bucketClient .MockGet ("user-1/markers/cleaner-visit-marker.json" , "" , nil )
732
733
bucketClient .MockUpload ("user-1/markers/cleaner-visit-marker.json" , nil )
@@ -973,8 +974,8 @@ func TestCompactor_ShouldCompactAllUsersOnShardingEnabledButOnlyOneInstanceRunni
973
974
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-1" ), false , nil )
974
975
bucketClient .MockExists (cortex_tsdb .GetGlobalDeletionMarkPath ("user-2" ), false , nil )
975
976
bucketClient .MockExists (cortex_tsdb .GetLocalDeletionMarkPath ("user-2" ), false , nil )
976
- bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D/meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
977
- bucketClient .MockIter ("user-2/" , []string {"user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ/meta.json" , "user-2/01FN3V83ABR9992RF8WRJZ76ZQ/meta.json" }, nil )
977
+ bucketClient .MockIter ("user-1/" , []string {"user-1/01DTVP434PA9VFXSW2JKB3392D" , "user-1/01DTVP434PA9VFXSW2JKB3392D /meta.json" , "user-1/01FN6CDF3PNEWWRY5MPGJPE3EX/meta.json" }, nil )
978
+ bucketClient .MockIter ("user-2/" , []string {"user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ" , "user-2/01DTW0ZCPDDNV4BV83Q2SV4QAZ /meta.json" , "user-2/01FN3V83ABR9992RF8WRJZ76ZQ/meta.json" }, nil )
978
979
bucketClient .MockIter ("user-1/markers/" , nil , nil )
979
980
bucketClient .MockGet ("user-1/markers/cleaner-visit-marker.json" , "" , nil )
980
981
bucketClient .MockUpload ("user-1/markers/cleaner-visit-marker.json" , nil )
@@ -1210,7 +1211,7 @@ func TestCompactor_ShouldCompactOnlyShardsOwnedByTheInstanceOnShardingEnabledWit
1210
1211
bucketClient .MockGetRequireUpload (userID + "/" + blockID + "/visit-mark.json" , string (visitMarkerFileContent ), nil )
1211
1212
bucketClient .MockUpload (userID + "/" + blockID + "/visit-mark.json" , nil )
1212
1213
// Iter with recursive so expected to get objects rather than directories.
1213
- blockFiles = append (blockFiles , path .Join (userID , blockID , block .MetaFilename ))
1214
+ blockFiles = append (blockFiles , path .Join (userID , blockID ), path . Join ( userID , blockID , block .MetaFilename ))
1214
1215
1215
1216
// Get all of the unique group hashes so that they can be used to ensure all groups were compacted
1216
1217
groupHash := hashGroup (userID , blockTimes ["startTime" ], blockTimes ["endTime" ])
0 commit comments