Skip to content

Commit

Permalink
Merge #104633
Browse files Browse the repository at this point in the history
104633: roachtest: only wait for jobs claimed by same node r=chengxiong-ruan a=chengxiong-ruan

Informs: #104177 (hopefully can fix it)
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

Co-authored-by: Chengxiong Ruan <chengxiongruan@gmail.com>
  • Loading branch information
craig[bot] and chengxiong-ruan committed Jun 9, 2023
2 parents 579914d + 8811ac5 commit 827a688
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 827a688

Please sign in to comment.