Skip to content

Commit d109d2a

Browse files
committed
mixedversion: don't mark shared process tenant availability in monitor
The monitor does not support monitoring shared process tenants in isolation, i.e. it can only monitor both system and the secondary shared process. However, the mixed version framework was reporting availability of shared process tenants to the monitor. This broke an assumption that the monitor makes that any registered process is either the system tenant or a separate process tenant. This would cause the monitor to mistakenly believe there was a running separate process tenant.
1 parent 7c9cfa3 commit d109d2a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

pkg/cmd/roachtest/roachtestutil/mixedversion/helper.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,19 @@ func (s *Service) RandomDB(rng *rand.Rand) (int, *gosql.DB) {
9797
return node, s.Connect(node)
9898
}
9999

100-
// prepareQuery returns a connection to one of the `nodes` provided
101-
// and logs the query and gateway node in the step's log file. Called
100+
// prepareQuery returns a connection to one of the available nodes in `nodes`
101+
// provided and logs the query and gateway node in the step's log file. Called
102102
// before the query is actually performed.
103103
func (s *Service) prepareQuery(
104104
rng *rand.Rand, nodes option.NodeListOption, query string, args ...any,
105105
) (*gosql.DB, error) {
106106
availableNodes := s.AvailableNodes().Intersect(nodes)
107+
if len(availableNodes) == 0 {
108+
return nil, errors.Newf(
109+
"no available nodes in the intersection of %s and %s",
110+
s.AvailableNodes(), nodes,
111+
)
112+
}
107113
node := availableNodes.SeededRandNode(rng)[0]
108114
db := s.Connect(node)
109115

@@ -137,8 +143,7 @@ func (s *Service) Exec(rng *rand.Rand, query string, args ...interface{}) error
137143
func (s *Service) ExecWithGateway(
138144
rng *rand.Rand, nodes option.NodeListOption, query string, args ...interface{},
139145
) error {
140-
availableNodes := s.AvailableNodes().Intersect(nodes)
141-
db, err := s.prepareQuery(rng, availableNodes, query, args...)
146+
db, err := s.prepareQuery(rng, nodes, query, args...)
142147
if err != nil {
143148
return err
144149
}

pkg/cmd/roachtest/roachtestutil/mixedversion/steps.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ func (s networkPartitionInjectStep) Run(
903903
ctx context.Context, l *logger.Logger, _ *rand.Rand, h *Helper,
904904
) error {
905905
h.runner.monitor.ExpectProcessDead(s.targetNode)
906-
if h.Tenant != nil {
906+
if h.DeploymentMode() == SeparateProcessDeployment {
907907
opt := option.VirtualClusterName(h.Tenant.Descriptor.Name)
908908
h.runner.monitor.ExpectProcessDead(s.targetNode, opt)
909909
}
@@ -958,7 +958,7 @@ func (s networkPartitionRecoveryStep) Run(
958958
}
959959

960960
h.runner.monitor.ExpectProcessAlive(s.targetNode)
961-
if h.Tenant != nil {
961+
if h.DeploymentMode() == SeparateProcessDeployment {
962962
opt := option.VirtualClusterName(h.Tenant.Descriptor.Name)
963963
h.runner.monitor.ExpectProcessAlive(s.targetNode, opt)
964964
}

0 commit comments

Comments
 (0)