You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sqlDB.Exec(t, fmt.Sprintf(`INSERT INTO %s VALUES (1, 'x'),(2,'y')`, tableName))
158
-
sqlDB.Exec(t, fmt.Sprintf("CREATE CHANGEFEED FOR %s INTO 'null://' WITH gc_protect_expires_after='2m', protect_data_from_gc_on_pause", tableName))
174
+
175
+
varjobID jobspb.JobID
176
+
sqlDB.QueryRow(t, fmt.Sprintf("CREATE CHANGEFEED FOR %s INTO 'null://' WITH gc_protect_expires_after='10m', protect_data_from_gc_on_pause", tableName)).Scan(&jobID)
177
+
178
+
jobIDToTableNameMu.Lock()
179
+
jobIDToTableName[jobID] =tableName
180
+
jobIDToTableNameMu.Unlock()
181
+
159
182
ifi%(tableCount/5) ==0 {
160
183
t.L().Printf("Created %d tables so far", i)
161
184
}
@@ -169,17 +192,17 @@ func checkJobQueryLatency(
169
192
ctx context.Context, t test.Test, c cluster.Cluster, rng*rand.Rand,
t.L().Printf("No table name found for job %d, skipping recreation", jobID)
285
+
continue
286
+
}
287
+
varnewJobID jobspb.JobID
288
+
err:=conn.QueryRowContext(ctx, fmt.Sprintf("CREATE CHANGEFEED FOR %s INTO 'null://' WITH gc_protect_expires_after='10m', protect_data_from_gc_on_pause", tableName)).Scan(&newJobID)
289
+
iferr==nil {
290
+
jobIDToTableNameMu.Lock()
291
+
jobIDToTableName[newJobID] =tableName
292
+
jobIDToTableNameMu.Unlock()
293
+
recreatedCount++
294
+
} else {
295
+
t.L().Printf("Failed to recreate changefeed for table %s (job %d): %v", tableName, jobID, err)
296
+
}
246
297
}
247
298
}
248
-
t.L().Printf("Failed to run %s on %d of %d jobs", cmd, errCount, count)
299
+
t.L().Printf("Failed to run %s on %d of %d jobs, recreated %d changefeeds, of %d total cf jobs", cmd, errCount, count, recreatedCount, len(jobs))
249
300
}
250
301
jobAction("PAUSE JOB $1", len(jobs)/10)
251
302
jobAction("RESUME JOB $1", len(jobs)/10)
252
303
returnnil
253
304
}
254
305
306
+
funcsplitScatterMergeJobsTable(
307
+
ctx context.Context, t test.Test, c cluster.Cluster, rng*rand.Rand,
308
+
) error {
309
+
conn:=c.Conn(ctx, t.L(), rng.Intn(nodeCount)+1)
310
+
deferconn.Close()
311
+
312
+
_, err:=conn.ExecContext(ctx, "ALTER TABLE system.jobs SPLIT AT (select id from system.jobs order by random() limit 3)")
313
+
iferr!=nil {
314
+
t.L().Printf("Error splitting %s", err)
315
+
}
316
+
317
+
returnnil
318
+
}
319
+
255
320
funccheckJobSystemHealth(ctx context.Context, t test.Test, c cluster.Cluster, rng*rand.Rand) {
0 commit comments