Skip to content

Commit

Permalink
compact restore: use closure to initial snapshot restore checkpoint (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer authored and terry1purcell committed Jan 28, 2025
1 parent 43f0eef commit 5e870f3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions br/pkg/restore/snap_client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ const minBatchDdlSize = 1

type SnapClient struct {
restorer restore.SstRestorer
<<<<<<< HEAD
importer *SnapFileImporter
=======
>>>>>>> 659e3e73dd (compact restore: use closure to initial snapshot restore checkpoint (#58146))
// Use a closure to lazy load checkpoint runner
getRestorerFn func(*checkpoint.CheckpointRunner[checkpoint.RestoreKeyType, checkpoint.RestoreValueType]) restore.SstRestorer
// Tool clients used by SnapClient
Expand Down Expand Up @@ -588,7 +591,11 @@ func (rc *SnapClient) initClients(ctx context.Context, backend *backuppb.Storage
}
// Raw/Txn restore are not support checkpoint for now
rc.getRestorerFn = func(checkpointRunner *checkpoint.CheckpointRunner[checkpoint.RestoreKeyType, checkpoint.RestoreValueType]) restore.SstRestorer {
<<<<<<< HEAD
return restore.NewSimpleSstRestorer(ctx, rc.importer, rc.workerPool, nil)
=======
return restore.NewSimpleSstRestorer(ctx, fileImporter, rc.workerPool, nil)
>>>>>>> 659e3e73dd (compact restore: use closure to initial snapshot restore checkpoint (#58146))
}
} else {
// or create a fileImporter with the cluster API version
Expand All @@ -598,7 +605,11 @@ func (rc *SnapClient) initClients(ctx context.Context, backend *backuppb.Storage
return errors.Trace(err)
}
rc.getRestorerFn = func(checkpointRunner *checkpoint.CheckpointRunner[checkpoint.RestoreKeyType, checkpoint.RestoreValueType]) restore.SstRestorer {
<<<<<<< HEAD
return restore.NewMultiTablesRestorer(ctx, rc.importer, rc.workerPool, checkpointRunner)
=======
return restore.NewMultiTablesRestorer(ctx, fileImporter, rc.workerPool, checkpointRunner)
>>>>>>> 659e3e73dd (compact restore: use closure to initial snapshot restore checkpoint (#58146))
}
}
return nil
Expand Down

0 comments on commit 5e870f3

Please sign in to comment.