@@ -504,18 +504,14 @@ func TestLegacyFindPriorBackups(t *testing.T) {
504
504
execCfg := tc .Server (0 ).ApplicationLayer ().ExecutorConfig ().(sql.ExecutorConfig )
505
505
emptyReader := bytes .NewReader (nil )
506
506
507
- writeManifest := func (t * testing.T , store cloud.ExternalStorage , path string , useOldBackup bool ) {
507
+ writeManifest := func (t * testing.T , store cloud.ExternalStorage , path string ) {
508
508
manifestName := backupbase .BackupManifestName
509
- if useOldBackup {
510
- manifestName = backupbase .BackupOldManifestName
511
- }
512
509
err := cloud .WriteFile (ctx , store , backuputils .JoinURLPath (path , manifestName ), emptyReader )
513
510
require .NoError (t , err )
514
511
}
515
512
516
513
type backupPath struct {
517
- path string
518
- useOldBackup bool
514
+ path string
519
515
}
520
516
type testcase struct {
521
517
name string
@@ -527,9 +523,9 @@ func TestLegacyFindPriorBackups(t *testing.T) {
527
523
{
528
524
name : "all suffixed paths" ,
529
525
paths : []backupPath {
530
- {path : "/20250320/001000.00-20250320-000000.00" , useOldBackup : false },
531
- {path : "/20250320/002000.00-20250320-001000.00" , useOldBackup : false },
532
- {path : "/20250320/003000.00-20250320-002000.00" , useOldBackup : false },
526
+ {path : "/20250320/001000.00-20250320-000000.00" },
527
+ {path : "/20250320/002000.00-20250320-001000.00" },
528
+ {path : "/20250320/003000.00-20250320-002000.00" },
533
529
},
534
530
expectedPaths : []string {
535
531
"/20250320/001000.00-20250320-000000.00" ,
@@ -540,35 +536,9 @@ func TestLegacyFindPriorBackups(t *testing.T) {
540
536
{
541
537
name : "all non-suffixed paths" ,
542
538
paths : []backupPath {
543
- {path : "/20250320/001000.00" , useOldBackup : false },
544
- {path : "/20250320/002000.00" , useOldBackup : false },
545
- {path : "/20250320/003000.00" , useOldBackup : false },
546
- },
547
- expectedPaths : []string {
548
- "/20250320/001000.00" ,
549
- "/20250320/002000.00" ,
550
- "/20250320/003000.00" ,
551
- },
552
- },
553
- {
554
- name : "all old backup paths" ,
555
- paths : []backupPath {
556
- {path : "/20250320/001000.00" , useOldBackup : true },
557
- {path : "/20250320/002000.00" , useOldBackup : true },
558
- {path : "/20250320/003000.00" , useOldBackup : true },
559
- },
560
- expectedPaths : []string {
561
- "/20250320/001000.00" ,
562
- "/20250320/002000.00" ,
563
- "/20250320/003000.00" ,
564
- },
565
- },
566
- {
567
- name : "mixed new and old backup paths" ,
568
- paths : []backupPath {
569
- {path : "/20250320/001000.00" , useOldBackup : false },
570
- {path : "/20250320/002000.00" , useOldBackup : true },
571
- {path : "/20250320/003000.00" , useOldBackup : false },
539
+ {path : "/20250320/001000.00" },
540
+ {path : "/20250320/002000.00" },
541
+ {path : "/20250320/003000.00" },
572
542
},
573
543
expectedPaths : []string {
574
544
"/20250320/001000.00" ,
@@ -579,9 +549,9 @@ func TestLegacyFindPriorBackups(t *testing.T) {
579
549
{
580
550
name : "mixed suffixed and non-suffixed paths" ,
581
551
paths : []backupPath {
582
- {path : "/20250320/001000.00-20250320-000000.00" , useOldBackup : false },
583
- {path : "/20250320/002000.00" , useOldBackup : false },
584
- {path : "/20250320/003000.00-20250320-002000.00" , useOldBackup : false },
552
+ {path : "/20250320/001000.00-20250320-000000.00" },
553
+ {path : "/20250320/002000.00" },
554
+ {path : "/20250320/003000.00-20250320-002000.00" },
585
555
},
586
556
expectedPaths : []string {
587
557
"/20250320/001000.00-20250320-000000.00" ,
@@ -592,16 +562,14 @@ func TestLegacyFindPriorBackups(t *testing.T) {
592
562
{
593
563
name : "invalid backup paths with valid backup paths" ,
594
564
paths : []backupPath {
595
- {path : "/20250320/001000.00-20250320-000000.00" , useOldBackup : false },
596
- {path : "/20250320/001500.000" , useOldBackup : false }, // invalid
597
- {path : "/20250320/002000.00" , useOldBackup : false },
598
- {path : "/2025/03/20/002500.00" , useOldBackup : false }, // invalid
599
- {path : "/20250320/003000.00" , useOldBackup : true },
565
+ {path : "/20250320/001000.00-20250320-000000.00" },
566
+ {path : "/20250320/001500.000" }, // invalid
567
+ {path : "/20250320/002000.00" },
568
+ {path : "/2025/03/20/002500.00" }, // invalid
600
569
},
601
570
expectedPaths : []string {
602
571
"/20250320/001000.00-20250320-000000.00" ,
603
572
"/20250320/002000.00" ,
604
- "/20250320/003000.00" ,
605
573
},
606
574
},
607
575
} {
@@ -617,7 +585,7 @@ func TestLegacyFindPriorBackups(t *testing.T) {
617
585
tc .paths [i ], tc .paths [j ] = tc .paths [j ], tc .paths [i ]
618
586
})
619
587
for _ , path := range tc .paths {
620
- writeManifest (t , store , path .path , path . useOldBackup )
588
+ writeManifest (t , store , path .path )
621
589
}
622
590
prev , err := backupdest .LegacyFindPriorBackups (ctx , store , false )
623
591
require .NoError (t , err )
0 commit comments