@@ -397,6 +397,10 @@ func (d *datadrivenTestState) getSQLDBForVC(
397397// - expect-pausepoint: expects the backup job to end up in a paused state because
398398// of a pausepoint error.
399399//
400+ // - aost: expects a tag referencing a previously saved cluster timestamp
401+ // using `save-cluster-ts`. It then runs the backup as of the saved cluster
402+ // timestamp.
403+ //
400404// - "restore" [args]
401405// Executes restore specific operations.
402406//
@@ -410,13 +414,29 @@ func (d *datadrivenTestState) getSQLDBForVC(
410414// - aost: expects a tag referencing a previously saved cluster timestamp
411415// using `save-cluster-ts`. It then runs the restore as of the saved cluster
412416// timestamp.
417+
418+ // - "compact" [args]
419+ // Executes compaction specific operations.
420+ //
421+ // Supported arguments:
422+ //
423+ // - tag=<tag>: tag the compaction job to reference it in the future.
424+ //
425+ // - expect-pausepoint: expects the restore job to end up in a paused state because
426+ // of a pausepoint error.
427+ //
428+ // - start: expects a tag referencing a previously saved cluster timestamp
429+ // using `save-cluster-ts`.
430+ //
431+ // - end: expects a tag referencing a previously saved cluster timestamp
432+ // using `save-cluster-ts`.
413433//
414434// - "schema" [args]
415435// Executes schema change specific operations.
416436//
417437// Supported arguments:
418438//
419- // - tag=<tag>: tag the schema change job to reference it in the future.
439+ // - tag=<tag>: tag the schema change job to reference it in the future.
420440//
421441// - expect-pausepoint: expects the schema change job to end up in a paused state because
422442// of a pausepoint error.
@@ -426,9 +446,9 @@ func (d *datadrivenTestState) getSQLDBForVC(
426446//
427447// Supported arguments:
428448//
429- // - type: kv request type. Currently, only DeleteRange is supported
449+ // - type: kv request type. Currently, only DeleteRange is supported
430450//
431- // - target: SQL target. Currently, only table names are supported.
451+ // - target: SQL target. Currently, only table names are supported.
432452//
433453// - "corrupt-backup" uri=<collectionUri>
434454// Finds the latest backup in the provided collection uri an flips a bit in one SST in the backup
@@ -797,6 +817,18 @@ func runTestDataDriven(t *testing.T, testFilePathFromWorkspace string) {
797817 return ""
798818
799819 case "backup" :
820+ if d .HasArg ("aost" ) {
821+ var aost string
822+ d .ScanArgs (t , "aost" , & aost )
823+ var ts string
824+ var ok bool
825+ if ts , ok = ds .clusterTimestamps [aost ]; ! ok {
826+ t .Fatalf ("no cluster timestamp found for %s" , aost )
827+ }
828+ // Replace the ts tag with the actual timestamp.
829+ d .Input = strings .Replace (d .Input , aost ,
830+ fmt .Sprintf ("'%s'" , ts ), 1 )
831+ }
800832 return execWithTagAndPausePoint (jobspb .TypeBackup )
801833
802834 case "import" :
@@ -818,6 +850,29 @@ func runTestDataDriven(t *testing.T, testFilePathFromWorkspace string) {
818850 }
819851 return execWithTagAndPausePoint (jobspb .TypeRestore )
820852
853+ case "compact" :
854+ if ! d .HasArg ("start" ) || ! d .HasArg ("end" ) {
855+ t .Fatalf ("must specify start and end for compaction" )
856+ }
857+ var start , end string
858+ d .ScanArgs (t , "start" , & start )
859+ d .ScanArgs (t , "end" , & end )
860+ var startTs , endTs string
861+ var ok bool
862+ if startTs , ok = ds .clusterTimestamps [start ]; ! ok {
863+ t .Fatalf ("no cluster timestamp found for %s" , start )
864+ }
865+ if endTs , ok = ds .clusterTimestamps [end ]; ! ok {
866+ t .Fatalf ("no cluster timestamp found for %s" , end )
867+ }
868+ // Replace the ts tag with the actual timestamp.
869+ // ds.clusterTimestamps stores a stringified nanosecond epoch.
870+ d .Input = strings .Replace (d .Input , start ,
871+ fmt .Sprintf ("'%s'::DECIMAL" , startTs ), 1 )
872+ d .Input = strings .Replace (d .Input , end ,
873+ fmt .Sprintf ("'%s'::DECIMAL" , endTs ), 1 )
874+
875+ return execWithTagAndPausePoint (jobspb .TypeBackup )
821876 case "new-schema-change" :
822877 return execWithTagAndPausePoint (jobspb .TypeNewSchemaChange )
823878
0 commit comments