Skip to content

Commit 497167b

Browse files
craig[bot]andreimatei
craig[bot]
andcommitted
Merge #39721
39721: serverutils: remove depency on kv r=andreimatei a=andreimatei See individual commits Co-authored-by: Andrei Matei <[email protected]>
2 parents 7fd65c9 + 10d7f64 commit 497167b

24 files changed

+113
-61
lines changed

pkg/ccl/backupccl/backup_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
"github.com/cockroachdb/cockroach/pkg/jobs"
3838
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
3939
"github.com/cockroachdb/cockroach/pkg/keys"
40+
"github.com/cockroachdb/cockroach/pkg/kv"
4041
"github.com/cockroachdb/cockroach/pkg/roachpb"
4142
"github.com/cockroachdb/cockroach/pkg/security"
4243
"github.com/cockroachdb/cockroach/pkg/sql"
@@ -2196,7 +2197,9 @@ func TestRestoreAsOfSystemTimeGCBounds(t *testing.T) {
21962197
},
21972198
Threshold: tc.Server(0).Clock().Now(),
21982199
}
2199-
if _, err := client.SendWrapped(ctx, tc.Server(0).DistSender(), &gcr); err != nil {
2200+
if _, err := client.SendWrapped(
2201+
ctx, tc.Server(0).DistSenderI().(*kv.DistSender), &gcr,
2202+
); err != nil {
22002203
t.Fatal(err)
22012204
}
22022205

pkg/ccl/changefeedccl/bench_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"time"
2020

2121
"github.com/cockroachdb/cockroach/pkg/base"
22+
"github.com/cockroachdb/cockroach/pkg/gossip"
2223
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
2324
"github.com/cockroachdb/cockroach/pkg/roachpb"
2425
"github.com/cockroachdb/cockroach/pkg/server"
@@ -205,7 +206,7 @@ func createBenchmarkChangefeed(
205206
nil /* curCount */, nil /* maxHist */, math.MaxInt64, settings,
206207
)
207208
poller := makePoller(
208-
settings, s.DB(), feedClock, s.Gossip(), spans, details, initialHighWater, buf,
209+
settings, s.DB(), feedClock, s.GossipI().(*gossip.Gossip), spans, details, initialHighWater, buf,
209210
leaseMgr, metrics, &mm,
210211
)
211212

pkg/ccl/changefeedccl/helpers_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/cockroachdb/apd"
2323
"github.com/cockroachdb/cockroach/pkg/base"
2424
"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdctest"
25+
"github.com/cockroachdb/cockroach/pkg/kv"
2526
"github.com/cockroachdb/cockroach/pkg/security"
2627
"github.com/cockroachdb/cockroach/pkg/sql/distsqlrun"
2728
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
@@ -329,5 +330,6 @@ func forceTableGC(
329330
database, table string,
330331
) {
331332
t.Helper()
332-
serverutils.ForceTableGC(t, tsi, sqlDB.DB, database, table, tsi.Clock().Now())
333+
sqlutils.ForceTableGC(
334+
t, tsi.DistSenderI().(*kv.DistSender), sqlDB.DB, database, table, tsi.Clock().Now())
333335
}

pkg/kv/dist_sender_server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ func TestParallelSender(t *testing.T) {
10551055
}
10561056

10571057
getPSCount := func() int64 {
1058-
return s.DistSender().Metrics().AsyncSentCount.Count()
1058+
return s.DistSenderI().(*kv.DistSender).Metrics().AsyncSentCount.Count()
10591059
}
10601060
psCount := getPSCount()
10611061

pkg/kv/txn_coord_sender_server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func TestHeartbeatFindsOutAboutAbortedTransaction(t *testing.T) {
9595
Clock: s.Clock(),
9696
Stopper: s.Stopper(),
9797
},
98-
s.DistSender(),
98+
s.DistSenderI().(*kv.DistSender),
9999
)
100100
db := client.NewDB(ambient, tsf, s.Clock())
101101
txn := client.NewTxn(ctx, db, 0 /* gatewayNodeID */, client.RootTxn)

pkg/server/testserver.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ func (ts *TestServer) Stopper() *stop.Stopper {
262262
return ts.stopper
263263
}
264264

265-
// Gossip returns the gossip instance used by the TestServer.
265+
// GossipI is part of TestServerInterface.
266+
func (ts *TestServer) GossipI() interface{} {
267+
return ts.Gossip()
268+
}
269+
270+
// Gossip is like GossipI but returns the real type instead of interface{}.
266271
func (ts *TestServer) Gossip() *gossip.Gossip {
267272
if ts != nil {
268273
return ts.gossip
@@ -590,11 +595,17 @@ func (ts *TestServer) GetNodeLiveness() *storage.NodeLiveness {
590595
return ts.nodeLiveness
591596
}
592597

593-
// DistSender exposes the Server's DistSender.
594-
func (ts *TestServer) DistSender() *kv.DistSender {
598+
// DistSenderI is part of DistSendeInterface.
599+
func (ts *TestServer) DistSenderI() interface{} {
595600
return ts.distSender
596601
}
597602

603+
// DistSender is like DistSenderI(), but returns the real type instead of
604+
// interface{}.
605+
func (ts *TestServer) DistSender() *kv.DistSender {
606+
return ts.DistSenderI().(*kv.DistSender)
607+
}
608+
598609
// DistSQLServer is part of TestServerInterface.
599610
func (ts *TestServer) DistSQLServer() interface{} {
600611
return ts.distSQLServer

pkg/sql/crdb_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestGossipAlertsTable(t *testing.T) {
3636
defer s.Stopper().Stop(context.TODO())
3737
ctx := context.TODO()
3838

39-
if err := s.Gossip().AddInfoProto(gossip.MakeNodeHealthAlertKey(456), &statuspb.HealthCheckResult{
39+
if err := s.GossipI().(*gossip.Gossip).AddInfoProto(gossip.MakeNodeHealthAlertKey(456), &statuspb.HealthCheckResult{
4040
Alerts: []statuspb.HealthAlert{{
4141
StoreID: 123,
4242
Category: statuspb.HealthAlert_METRICS,

pkg/sql/create_stats_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"time"
2020

2121
"github.com/cockroachdb/cockroach/pkg/base"
22+
"github.com/cockroachdb/cockroach/pkg/kv"
2223
"github.com/cockroachdb/cockroach/pkg/security"
2324
"github.com/cockroachdb/cockroach/pkg/sql/distsqlrun"
2425
"github.com/cockroachdb/cockroach/pkg/testutils"
@@ -97,7 +98,9 @@ func TestStatsWithLowTTL(t *testing.T) {
9798
return
9899
}
99100
// Force a table GC of values older than 1 second.
100-
serverutils.ForceTableGC(t, s, db2, "test", "t", s.Clock().Now().Add(-int64(1*time.Second), 0))
101+
sqlutils.ForceTableGC(
102+
t, s.DistSenderI().(*kv.DistSender), db2,
103+
"test", "t", s.Clock().Now().Add(-int64(1*time.Second), 0))
101104
time.Sleep(10 * time.Millisecond)
102105
}
103106
}()

pkg/sql/distsql_physical_planner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func TestDistSQLRangeCachesIntegrationTest(t *testing.T) {
346346
//
347347
// TODO(andrei): This is super hacky. What this test really wants to do is to
348348
// precisely control the contents of the range cache on node 4.
349-
tc.Server(3).DistSender().DisableFirstRangeUpdates()
349+
tc.Server(3).DistSenderI().(*kv.DistSender).DisableFirstRangeUpdates()
350350
db3 := tc.ServerConn(3)
351351
// Do a query on node 4 so that it populates the its cache with an initial
352352
// descriptor containing all the SQL key space. If we don't do this, the state

pkg/sql/distsql_running_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func TestDistSQLRunningInAbortedTxn(t *testing.T) {
9999
Clock: s.Clock(),
100100
Stopper: s.Stopper(),
101101
},
102-
s.DistSender(),
102+
s.DistSenderI().(*kv.DistSender),
103103
)
104104
shortDB := client.NewDB(ambient, tsf, s.Clock())
105105

pkg/sql/distsqlplan/span_resolver_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"time"
1919

2020
"github.com/cockroachdb/cockroach/pkg/base"
21+
"github.com/cockroachdb/cockroach/pkg/gossip"
2122
"github.com/cockroachdb/cockroach/pkg/internal/client"
2223
"github.com/cockroachdb/cockroach/pkg/kv"
2324
"github.com/cockroachdb/cockroach/pkg/roachpb"
@@ -83,7 +84,7 @@ func TestSpanResolverUsesCaches(t *testing.T) {
8384

8485
lr := distsqlplan.NewSpanResolver(
8586
s3.Cfg.Settings,
86-
s3.DistSender(), s3.Gossip(), s3.GetNode().Descriptor, nil,
87+
s3.DistSenderI().(*kv.DistSender), s3.Gossip(), s3.GetNode().Descriptor, nil,
8788
replicaoracle.BinPackingChoice)
8889

8990
var spans []spanWithDir
@@ -189,7 +190,7 @@ func TestSpanResolver(t *testing.T) {
189190
rowRanges, tableDesc := setupRanges(db, s.(*server.TestServer), cdb, t)
190191
lr := distsqlplan.NewSpanResolver(
191192
s.(*server.TestServer).Cfg.Settings,
192-
s.DistSender(), s.Gossip(),
193+
s.DistSenderI().(*kv.DistSender), s.GossipI().(*gossip.Gossip),
193194
s.(*server.TestServer).GetNode().Descriptor, nil,
194195
replicaoracle.BinPackingChoice)
195196

@@ -283,7 +284,7 @@ func TestMixedDirections(t *testing.T) {
283284
rowRanges, tableDesc := setupRanges(db, s.(*server.TestServer), cdb, t)
284285
lr := distsqlplan.NewSpanResolver(
285286
s.(*server.TestServer).Cfg.Settings,
286-
s.DistSender(), s.Gossip(),
287+
s.DistSenderI().(*kv.DistSender), s.GossipI().(*gossip.Gossip),
287288
s.(*server.TestServer).GetNode().Descriptor,
288289
nil,
289290
replicaoracle.BinPackingChoice)

pkg/sql/distsqlrun/sample_aggregator_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"testing"
1818

1919
"github.com/cockroachdb/cockroach/pkg/base"
20+
"github.com/cockroachdb/cockroach/pkg/gossip"
2021
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
2122
"github.com/cockroachdb/cockroach/pkg/sql/distsqlpb"
2223
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
@@ -48,7 +49,7 @@ func TestSampleAggregator(t *testing.T) {
4849
Settings: st,
4950
DB: kvDB,
5051
Executor: server.InternalExecutor().(sqlutil.InternalExecutor),
51-
Gossip: server.Gossip(),
52+
Gossip: server.GossipI().(*gossip.Gossip),
5253
},
5354
}
5455
// Override the default memory limit. If memLimitBytes is small but

pkg/sql/distsqlrun/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func TestDistSQLServerGossipsVersion(t *testing.T) {
162162
defer s.Stopper().Stop(context.TODO())
163163

164164
var v distsqlpb.DistSQLVersionGossipInfo
165-
if err := s.Gossip().GetInfoProto(
165+
if err := s.GossipI().(*gossip.Gossip).GetInfoProto(
166166
gossip.MakeDistSQLNodeVersionKey(s.NodeID()), &v,
167167
); err != nil {
168168
t.Fatal(err)

pkg/sql/schema_changer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/cockroachdb/cockroach/pkg/jobs"
2929
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
3030
"github.com/cockroachdb/cockroach/pkg/keys"
31+
"github.com/cockroachdb/cockroach/pkg/kv"
3132
"github.com/cockroachdb/cockroach/pkg/roachpb"
3233
"github.com/cockroachdb/cockroach/pkg/security"
3334
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
@@ -3387,7 +3388,7 @@ func TestIndexBackfillAfterGC(t *testing.T) {
33873388
RequestHeader: roachpb.RequestHeaderFromSpan(sp),
33883389
Threshold: tc.Server(0).Clock().Now(),
33893390
}
3390-
_, err := client.SendWrapped(ctx, tc.Server(0).DistSender(), &gcr)
3391+
_, err := client.SendWrapped(ctx, tc.Server(0).DistSenderI().(*kv.DistSender), &gcr)
33913392
if err != nil {
33923393
panic(err)
33933394
}

pkg/sql/stats/automatic_stats_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"time"
1919

2020
"github.com/cockroachdb/cockroach/pkg/base"
21+
"github.com/cockroachdb/cockroach/pkg/gossip"
2122
"github.com/cockroachdb/cockroach/pkg/internal/client"
2223
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
2324
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
@@ -53,7 +54,7 @@ func TestMaybeRefreshStats(t *testing.T) {
5354

5455
executor := s.InternalExecutor().(sqlutil.InternalExecutor)
5556
descA := sqlbase.GetTableDescriptor(s.DB(), "t", "a")
56-
cache := NewTableStatisticsCache(10 /* cacheSize */, s.Gossip(), kvDB, executor)
57+
cache := NewTableStatisticsCache(10 /* cacheSize */, s.GossipI().(*gossip.Gossip), kvDB, executor)
5758
refresher := MakeRefresher(st, executor, cache, time.Microsecond /* asOfTime */)
5859

5960
// There should not be any stats yet.
@@ -123,7 +124,7 @@ func TestAverageRefreshTime(t *testing.T) {
123124

124125
executor := s.InternalExecutor().(sqlutil.InternalExecutor)
125126
tableID := sqlbase.GetTableDescriptor(s.DB(), "t", "a").ID
126-
cache := NewTableStatisticsCache(10 /* cacheSize */, s.Gossip(), kvDB, executor)
127+
cache := NewTableStatisticsCache(10 /* cacheSize */, s.GossipI().(*gossip.Gossip), kvDB, executor)
127128
refresher := MakeRefresher(st, executor, cache, time.Microsecond /* asOfTime */)
128129

129130
checkAverageRefreshTime := func(expected time.Duration) error {
@@ -339,7 +340,7 @@ func TestAutoStatsReadOnlyTables(t *testing.T) {
339340
CREATE TABLE t.a (k INT PRIMARY KEY);`)
340341

341342
executor := s.InternalExecutor().(sqlutil.InternalExecutor)
342-
cache := NewTableStatisticsCache(10 /* cacheSize */, s.Gossip(), kvDB, executor)
343+
cache := NewTableStatisticsCache(10 /* cacheSize */, s.GossipI().(*gossip.Gossip), kvDB, executor)
343344
refresher := MakeRefresher(st, executor, cache, time.Microsecond /* asOfTime */)
344345

345346
AutomaticStatisticsClusterMode.Override(&st.SV, true)
@@ -370,7 +371,7 @@ func TestNoRetryOnFailure(t *testing.T) {
370371
defer evalCtx.Stop(ctx)
371372

372373
executor := s.InternalExecutor().(sqlutil.InternalExecutor)
373-
cache := NewTableStatisticsCache(10 /* cacheSize */, s.Gossip(), kvDB, executor)
374+
cache := NewTableStatisticsCache(10 /* cacheSize */, s.GossipI().(*gossip.Gossip), kvDB, executor)
374375
r := MakeRefresher(st, executor, cache, time.Microsecond /* asOfTime */)
375376

376377
// Try to refresh stats on a table that doesn't exist.

pkg/sql/stats/delete_stats_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"time"
1919

2020
"github.com/cockroachdb/cockroach/pkg/base"
21+
"github.com/cockroachdb/cockroach/pkg/gossip"
2122
"github.com/cockroachdb/cockroach/pkg/internal/client"
2223
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
2324
"github.com/cockroachdb/cockroach/pkg/sql/sqlutil"
@@ -33,7 +34,7 @@ func TestDeleteOldStatsForColumns(t *testing.T) {
3334
s, _, db := serverutils.StartServer(t, base.TestServerArgs{})
3435
defer s.Stopper().Stop(ctx)
3536
ex := s.InternalExecutor().(sqlutil.InternalExecutor)
36-
cache := NewTableStatisticsCache(10 /* cacheSize */, s.Gossip(), db, ex)
37+
cache := NewTableStatisticsCache(10 /* cacheSize */, s.GossipI().(*gossip.Gossip), db, ex)
3738

3839
// The test data must be ordered by CreatedAt DESC so the calculated set of
3940
// expected deleted stats is correct.

pkg/sql/stats/gossip_invalidation_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"testing"
1717

1818
"github.com/cockroachdb/cockroach/pkg/base"
19+
"github.com/cockroachdb/cockroach/pkg/gossip"
1920
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
2021
"github.com/cockroachdb/cockroach/pkg/sql/sqlutil"
2122
"github.com/cockroachdb/cockroach/pkg/sql/stats"
@@ -36,7 +37,7 @@ func TestGossipInvalidation(t *testing.T) {
3637

3738
sc := stats.NewTableStatisticsCache(
3839
10, /* cacheSize */
39-
tc.Server(0).Gossip(),
40+
tc.Server(0).GossipI().(*gossip.Gossip),
4041
tc.Server(0).DB(),
4142
tc.Server(0).InternalExecutor().(sqlutil.InternalExecutor),
4243
)

pkg/sql/stats/stats_cache_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"time"
2121

2222
"github.com/cockroachdb/cockroach/pkg/base"
23+
"github.com/cockroachdb/cockroach/pkg/gossip"
2324
"github.com/cockroachdb/cockroach/pkg/internal/client"
2425
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
2526
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
@@ -209,7 +210,7 @@ func TestCacheBasic(t *testing.T) {
209210
// Create a cache and iteratively query the cache for each tableID. This
210211
// will result in the cache getting populated. When the stats cache size is
211212
// exceeded, entries should be evicted according to the LRU policy.
212-
sc := NewTableStatisticsCache(2 /* cacheSize */, s.Gossip(), db, ex)
213+
sc := NewTableStatisticsCache(2 /* cacheSize */, s.GossipI().(*gossip.Gossip), db, ex)
213214
for _, tableID := range tableIDs {
214215
if err := checkStatsForTable(ctx, sc, expectedStats[tableID], tableID); err != nil {
215216
t.Fatal(err)
@@ -263,7 +264,7 @@ func TestCacheWait(t *testing.T) {
263264
}
264265
sort.Sort(tableIDs)
265266

266-
sc := NewTableStatisticsCache(len(tableIDs), s.Gossip(), db, ex)
267+
sc := NewTableStatisticsCache(len(tableIDs), s.GossipI().(*gossip.Gossip), db, ex)
267268
for _, tableID := range tableIDs {
268269
if err := checkStatsForTable(ctx, sc, expectedStats[tableID], tableID); err != nil {
269270
t.Fatal(err)

pkg/sqlmigrations/migrations_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"time"
2020

2121
"github.com/cockroachdb/cockroach/pkg/base"
22+
"github.com/cockroachdb/cockroach/pkg/gossip"
2223
"github.com/cockroachdb/cockroach/pkg/internal/client"
2324
"github.com/cockroachdb/cockroach/pkg/keys"
2425
"github.com/cockroachdb/cockroach/pkg/roachpb"
@@ -601,7 +602,7 @@ func TestExpectedInitialRangeCount(t *testing.T) {
601602
return errors.New("last migration has not completed")
602603
}
603604

604-
sysCfg := s.Gossip().GetSystemConfig()
605+
sysCfg := s.GossipI().(*gossip.Gossip).GetSystemConfig()
605606
if sysCfg == nil {
606607
return errors.New("gossipped system config not available")
607608
}

pkg/storage/bulk/sst_batcher_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ func runTestImport(t *testing.T, batchSize uint64) {
119119
if err != nil {
120120
t.Fatal(err)
121121
}
122-
r, _, err := s.DistSender().RangeDescriptorCache().LookupRangeDescriptorWithEvictionToken(ctx, addr, nil, false)
122+
r, _, err := s.DistSenderI().(*kv.DistSender).RangeDescriptorCache().LookupRangeDescriptorWithEvictionToken(
123+
ctx, addr, nil, false)
123124
if err != nil {
124125
t.Fatal(err)
125126
}

pkg/storage/gossip_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func TestGossipHandlesReplacedNode(t *testing.T) {
176176
tc.StopServer(oldNodeIdx)
177177
tc.AddServer(t, newServerArgs)
178178

179-
tc.WaitForStores(t, tc.Server(1).Gossip())
179+
tc.WaitForStores(t, tc.Server(1).GossipI().(*gossip.Gossip))
180180

181181
// Ensure that all servers still running are responsive. If the two remaining
182182
// original nodes don't refresh their connection to the address of the first

pkg/storage/replica_rangefeed_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"time"
1818

1919
"github.com/cockroachdb/cockroach/pkg/internal/client"
20+
"github.com/cockroachdb/cockroach/pkg/kv"
2021
"github.com/cockroachdb/cockroach/pkg/roachpb"
2122
"github.com/cockroachdb/cockroach/pkg/storage"
2223
"github.com/cockroachdb/cockroach/pkg/testutils"
@@ -695,7 +696,7 @@ func TestReplicaRangefeedNudgeSlowClosedTimestamp(t *testing.T) {
695696
rangeFeedChs := make([]chan *roachpb.RangeFeedEvent, len(repls))
696697
rangeFeedErrC := make(chan error, len(repls))
697698
for i := range repls {
698-
ds := tc.Server(i).DistSender()
699+
ds := tc.Server(i).DistSenderI().(*kv.DistSender)
699700
rangeFeedCh := make(chan *roachpb.RangeFeedEvent)
700701
rangeFeedChs[i] = rangeFeedCh
701702
go func() {

0 commit comments

Comments
 (0)