We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ab41a0 commit 3ca02e0Copy full SHA for 3ca02e0
nexus/db-queries/src/db/datastore/sled.rs
@@ -247,11 +247,20 @@ impl DataStore {
247
}
248
249
sql_function!(fn random() -> diesel::sql_types::Float);
250
+
251
+ // We only actually care about one target here, so this
252
+ // query should have a `.limit(1)` attached. We fetch all
253
+ // sled targets to leave additional debugging information in
254
+ // the logs, for now.
255
let sled_targets = sled_targets
256
.order(random())
- .limit(1)
257
.get_results_async::<Uuid>(&conn)
258
.await?;
259
+ info!(
260
+ opctx.log,
261
+ "found {} available sled targets", sled_targets.len();
262
+ "sled_ids" => ?sled_targets,
263
+ );
264
265
if sled_targets.is_empty() {
266
return Err(err.bail(SledReservationError::NotFound));
0 commit comments