Skip to content

Commit

Permalink
batcheval: fix incorrect StartTime in ExportResponse
Browse files Browse the repository at this point in the history
Previously, ExportResponse for a revision history backup
was always setting the `StartTime` in the response to the
GCThreshold of the span being exported. This is correct for
a full backup where revision history stretches only as far back
as the GCThreshold, but is incorrect for incremental backups
where the StartTime should stretch as far back as the StartTime
of the ExportRequest.

Thankfully, this StartTime in ExportResponse is only used for
validating that the restore AOST is greater than the StartTime
of the full backup i.e. this field is inconsequential for incrementals.
Nonetheless, we should send back an accurate response.

Release note: None

Release justification: low risk bug fix
  • Loading branch information
adityamaru committed Aug 26, 2022
1 parent d278d09 commit 8709b40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kv/kvserver/batcheval/cmd_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ func evalExport(
// BACKUP to correctly note the supported time bounds for RESTORE AS OF SYSTEM
// TIME.
if args.MVCCFilter == roachpb.MVCCFilter_All {
reply.StartTime = cArgs.EvalCtx.GetGCThreshold()
reply.StartTime = args.StartTime
if args.StartTime.IsEmpty() {
reply.StartTime = cArgs.EvalCtx.GetGCThreshold()
}
}

var exportAllRevisions bool
Expand Down

0 comments on commit 8709b40

Please sign in to comment.