Skip to content

Commit

Permalink
pcr: use the bulk oracle
Browse files Browse the repository at this point in the history
Release note: none.
Epic: none.
  • Loading branch information
dt committed Mar 18, 2024
1 parent 0b6de9c commit 58be95d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/streamingccl/streamproducer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_library(
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/streamingccl/streamproducer",
visibility = ["//visibility:public"],
deps = [
"//pkg/ccl/kvccl/kvfollowerreadsccl",
"//pkg/ccl/streamingccl",
"//pkg/ccl/streamingccl/replicationutils",
"//pkg/ccl/utilccl",
Expand Down
8 changes: 6 additions & 2 deletions pkg/ccl/streamingccl/streamproducer/stream_lifetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"context"
"time"

"github.com/cockroachdb/cockroach/pkg/ccl/kvccl/kvfollowerreadsccl"
"github.com/cockroachdb/cockroach/pkg/ccl/streamingccl"
"github.com/cockroachdb/cockroach/pkg/jobs"
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
Expand Down Expand Up @@ -294,8 +295,11 @@ func buildReplicationStreamSpec(

// Partition the spans with SQLPlanner
dsp := jobExecCtx.DistSQLPlanner()
planCtx := dsp.NewPlanningCtx(
ctx, jobExecCtx.ExtendedEvalContext(), nil /* planner */, nil /* txn */, sql.FullDistribution,
noLoc := roachpb.Locality{}
oracle := kvfollowerreadsccl.NewBulkOracle(dsp.ReplicaOracleConfig(evalCtx.Locality), noLoc)

planCtx := dsp.NewPlanningCtxWithOracle(
ctx, jobExecCtx.ExtendedEvalContext(), nil /* planner */, nil /* txn */, sql.FullDistribution, oracle, noLoc,
)

spanPartitions, err := dsp.PartitionSpans(ctx, planCtx, targetSpans)
Expand Down

0 comments on commit 58be95d

Please sign in to comment.