Skip to content

Commit a78dff7

Browse files
committed
jobfrontier: change Get to accept read-only frontier
This patch changes `Get` to accept a read-only frontier to prevent any accidental modification of the passed-in frontier. Release note: None
1 parent 9fab63b commit a78dff7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/jobs/jobfrontier/frontier.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ func Get(
8282
// InfoStorage keys are prefixed with "frontier/", the passed name, and then a
8383
// chunk identifier.
8484
func Store(
85-
ctx context.Context, txn isql.Txn, jobID jobspb.JobID, name string, frontier span.Frontier,
85+
ctx context.Context,
86+
txn isql.Txn,
87+
jobID jobspb.JobID,
88+
name string,
89+
frontier span.ReadOnlyFrontier,
8690
) error {
8791
return storeChunked(ctx, txn, jobID, name, frontier, 2<<20 /* 2mb */)
8892
}
@@ -92,7 +96,7 @@ func storeChunked(
9296
txn isql.Txn,
9397
jobID jobspb.JobID,
9498
name string,
95-
frontier span.Frontier,
99+
frontier span.ReadOnlyFrontier,
96100
chunkSize int,
97101
) error {
98102
infoStorage := jobs.InfoStorageForJob(txn, jobID)

0 commit comments

Comments
 (0)