@@ -21,6 +21,7 @@ import (
21
21
"github.com/thanos-io/thanos/pkg/block/metadata"
22
22
23
23
"github.com/cortexproject/cortex/pkg/storage/bucket"
24
+ "github.com/cortexproject/cortex/pkg/storage/parquet"
24
25
"github.com/cortexproject/cortex/pkg/storage/tsdb"
25
26
"github.com/cortexproject/cortex/pkg/storage/tsdb/bucketindex"
26
27
cortex_testutil "github.com/cortexproject/cortex/pkg/storage/tsdb/testutil"
@@ -161,6 +162,7 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
161
162
require .NoError (t , tsdb .WriteTenantDeletionMark (context .Background (), bucketClient , "user-3" , tsdb .NewTenantDeletionMark (time .Now ())))
162
163
block9 := createTSDBBlock (t , bucketClient , "user-3" , 10 , 30 , nil )
163
164
block10 := createTSDBBlock (t , bucketClient , "user-3" , 30 , 50 , nil )
165
+ createParquetMarker (t , bucketClient , "user-3" , block10 )
164
166
165
167
// User-4 with no more blocks, but couple of mark and debug files. Should be fully deleted.
166
168
user4Mark := tsdb .NewTenantDeletionMark (time .Now ())
@@ -174,6 +176,10 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
174
176
block12 := createTSDBBlock (t , bucketClient , "user-5" , 30 , 50 , nil )
175
177
createNoCompactionMark (t , bucketClient , "user-5" , block12 )
176
178
179
+ // Create Parquet marker
180
+ block13 := createTSDBBlock (t , bucketClient , "user-6" , 30 , 50 , nil )
181
+ createParquetMarker (t , bucketClient , "user-6" , block13 )
182
+
177
183
// The fixtures have been created. If the bucket client wasn't wrapped to write
178
184
// deletion marks to the global location too, then this is the right time to do it.
179
185
if options .markersMigrationEnabled {
@@ -230,7 +236,9 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
230
236
{path : path .Join ("user-3" , block9 .String (), "index" ), expectedExists : false },
231
237
{path : path .Join ("user-3" , block10 .String (), metadata .MetaFilename ), expectedExists : false },
232
238
{path : path .Join ("user-3" , block10 .String (), "index" ), expectedExists : false },
239
+ {path : path .Join ("user-3" , block10 .String (), parquet .ConverterMarkerFileName ), expectedExists : false },
233
240
{path : path .Join ("user-4" , block .DebugMetas , "meta.json" ), expectedExists : options .user4FilesExist },
241
+ {path : path .Join ("user-6" , block13 .String (), parquet .ConverterMarkerFileName ), expectedExists : true },
234
242
} {
235
243
exists , err := bucketClient .Exists (ctx , tc .path )
236
244
require .NoError (t , err )
@@ -298,21 +306,25 @@ func testBlocksCleanerWithOptions(t *testing.T, options testBlocksCleanerOptions
298
306
cortex_bucket_blocks_count{user="user-1"} 2
299
307
cortex_bucket_blocks_count{user="user-2"} 1
300
308
cortex_bucket_blocks_count{user="user-5"} 2
309
+ cortex_bucket_blocks_count{user="user-6"} 1
301
310
# HELP cortex_bucket_blocks_marked_for_deletion_count Total number of blocks marked for deletion in the bucket.
302
311
# TYPE cortex_bucket_blocks_marked_for_deletion_count gauge
303
312
cortex_bucket_blocks_marked_for_deletion_count{user="user-1"} 1
304
313
cortex_bucket_blocks_marked_for_deletion_count{user="user-2"} 0
305
314
cortex_bucket_blocks_marked_for_deletion_count{user="user-5"} 0
315
+ cortex_bucket_blocks_marked_for_deletion_count{user="user-6"} 0
306
316
# HELP cortex_bucket_blocks_marked_for_no_compaction_count Total number of blocks marked for no compaction in the bucket.
307
317
# TYPE cortex_bucket_blocks_marked_for_no_compaction_count gauge
308
318
cortex_bucket_blocks_marked_for_no_compaction_count{user="user-1"} 0
309
319
cortex_bucket_blocks_marked_for_no_compaction_count{user="user-2"} 0
310
320
cortex_bucket_blocks_marked_for_no_compaction_count{user="user-5"} 1
321
+ cortex_bucket_blocks_marked_for_no_compaction_count{user="user-6"} 0
311
322
# HELP cortex_bucket_blocks_partials_count Total number of partial blocks.
312
323
# TYPE cortex_bucket_blocks_partials_count gauge
313
324
cortex_bucket_blocks_partials_count{user="user-1"} 2
314
325
cortex_bucket_blocks_partials_count{user="user-2"} 0
315
326
cortex_bucket_blocks_partials_count{user="user-5"} 0
327
+ cortex_bucket_blocks_partials_count{user="user-6"} 0
316
328
` ),
317
329
"cortex_bucket_blocks_count" ,
318
330
"cortex_bucket_blocks_marked_for_deletion_count" ,
0 commit comments