Skip to content

Commit

Permalink
roachtest: only wait for jobs claimed by same node
Browse files Browse the repository at this point in the history
Previously, when disabling job adoptions within roachtest,
we simply select everything from `SHOW JOBS`. This is not adequate
because `SHOW JOBS` returns jobs claimed by other nodes as well.
This fails our roachtest occasionally if there were any jobs adopted
by other nodes and running. This commit makes it only querying running
jobs claimed by the same node.

Release note: None
  • Loading branch information
chengxiong-ruan committed Jun 8, 2023
1 parent 473592f commit 8811ac5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func disableJobAdoptionStep(c cluster.Cluster, nodeIDs option.NodeListOption) ve
defer gatewayDB.Close()

var runningJobIDs []jobspb.JobID
row, err := gatewayDB.Query(`SELECT job_id FROM [SHOW JOBS] WHERE status = 'running'`)
row, err := gatewayDB.Query(fmt.Sprintf(`SELECT job_id FROM [SHOW JOBS] WHERE status = 'running' AND coordinator_id = %d`, nodeID))
require.NoError(t, err)
for row.Next() {
var jobID int64
Expand Down

0 comments on commit 8811ac5

Please sign in to comment.