Skip to content

Commit 77669cd

Browse files
authored
Log all possible sled targets when creating a reservation (#5182)
We hope this gives us some insight into #5181.
1 parent dcd3d9e commit 77669cd

File tree

1 file changed

+10
-1
lines changed
  • nexus/db-queries/src/db/datastore

1 file changed

+10
-1
lines changed

nexus/db-queries/src/db/datastore/sled.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,20 @@ impl DataStore {
247247
}
248248

249249
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.
250255
let sled_targets = sled_targets
251256
.order(random())
252-
.limit(1)
253257
.get_results_async::<Uuid>(&conn)
254258
.await?;
259+
info!(
260+
opctx.log,
261+
"found {} available sled targets", sled_targets.len();
262+
"sled_ids" => ?sled_targets,
263+
);
255264

256265
if sled_targets.is_empty() {
257266
return Err(err.bail(SledReservationError::NotFound));

0 commit comments

Comments
 (0)