Skip to content

Commit

Permalink
Merge pull request #80387 from dt/sst-admission
Browse files Browse the repository at this point in the history
release-21.2: kv: send AddSSTable with BulkNormalPri
  • Loading branch information
dt authored Apr 22, 2022
2 parents a9feedd + 7df6559 commit 33197c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kv/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/protoutil"
"github.com/cockroachdb/cockroach/pkg/util/retry"
"github.com/cockroachdb/cockroach/pkg/util/stop"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/errors"
)

Expand Down Expand Up @@ -668,6 +669,12 @@ func (db *DB) AddSSTable(
batchTs hlc.Timestamp,
) error {
b := &Batch{Header: roachpb.Header{Timestamp: batchTs}}
b.AdmissionHeader = roachpb.AdmissionHeader{
Priority: int32(admission.BulkNormalPri),
CreateTime: timeutil.Now().UnixNano(),
Source: roachpb.AdmissionHeader_FROM_SQL,
NoMemoryReservedAtSource: true,
}
b.addSSTable(begin, end, data, disallowShadowing, stats, ingestAsWrites)
return getOneErr(db.Run(ctx, b), b)
}
Expand Down

0 comments on commit 33197c4

Please sign in to comment.