@@ -1643,7 +1643,7 @@ struct CrucibleDatasetRow {
16431643 // dataset fields
16441644 id : DatasetUuid ,
16451645 time_deleted : String ,
1646- pool_id : Uuid ,
1646+ pool_id : ZpoolUuid ,
16471647 address : String ,
16481648 size_used : i64 ,
16491649 no_provision : bool ,
@@ -1679,34 +1679,33 @@ async fn get_crucible_dataset_rows(
16791679 bail ! ( "no latest inventory found!" ) ;
16801680 } ;
16811681
1682- let mut zpool_total_size: HashMap < Uuid , i64 > = HashMap :: new ( ) ;
1682+ let mut zpool_total_size: HashMap < ZpoolUuid , i64 > = HashMap :: new ( ) ;
16831683
16841684 for sled_agent in latest_collection. sled_agents {
16851685 for zpool in sled_agent. zpools {
1686- zpool_total_size
1687- . insert ( zpool. id . into_untyped_uuid ( ) , zpool. total_size . into ( ) ) ;
1686+ zpool_total_size. insert ( zpool. id , zpool. total_size . into ( ) ) ;
16881687 }
16891688 }
16901689
1691- let zpools: HashMap < Uuid , Zpool > = datastore
1690+ let zpools: HashMap < ZpoolUuid , Zpool > = datastore
16921691 . zpool_list_all_external_batched ( opctx)
16931692 . await ?
16941693 . into_iter ( )
1695- . map ( |( zpool, _) | ( zpool. id ( ) . into_untyped_uuid ( ) , zpool) )
1694+ . map ( |( zpool, _) | ( zpool. id ( ) , zpool) )
16961695 . collect ( ) ;
16971696
16981697 let mut result: Vec < CrucibleDatasetRow > =
16991698 Vec :: with_capacity ( crucible_datasets. len ( ) ) ;
17001699
17011700 for d in crucible_datasets {
17021701 let control_plane_storage_buffer: Option < i64 > = match zpools
1703- . get ( & d. pool_id )
1702+ . get ( & d. pool_id ( ) )
17041703 {
17051704 Some ( zpool) => Some ( zpool. control_plane_storage_buffer ( ) . into ( ) ) ,
17061705 None => None ,
17071706 } ;
17081707
1709- let pool_total_size = zpool_total_size. get ( & d. pool_id ) ;
1708+ let pool_total_size = zpool_total_size. get ( & d. pool_id ( ) ) ;
17101709
17111710 result. push ( CrucibleDatasetRow {
17121711 // dataset fields
@@ -1715,7 +1714,7 @@ async fn get_crucible_dataset_rows(
17151714 Some ( t) => t. to_string ( ) ,
17161715 None => String :: from ( "" ) ,
17171716 } ,
1718- pool_id : d. pool_id ,
1717+ pool_id : d. pool_id ( ) ,
17191718 address : d. address ( ) . to_string ( ) ,
17201719 size_used : d. size_used ,
17211720 no_provision : d. no_provision ( ) ,
@@ -2200,7 +2199,7 @@ async fn cmd_db_disk_info(
22002199
22012200 let mut rows = Vec :: with_capacity ( 3 ) ;
22022201 for ( dataset, region) in regions {
2203- let my_pool_id = dataset. pool_id ;
2202+ let my_pool_id = dataset. pool_id ( ) ;
22042203 let ( _, my_zpool) = LookupPath :: new ( opctx, datastore)
22052204 . zpool_id ( my_pool_id)
22062205 . fetch ( )
@@ -2219,7 +2218,7 @@ async fn cmd_db_disk_info(
22192218 host_serial : my_sled. serial_number ( ) . to_string ( ) ,
22202219 region : region. id ( ) . to_string ( ) ,
22212220 dataset : dataset. id ( ) . to_string ( ) ,
2222- physical_disk : my_zpool. physical_disk_id . to_string ( ) ,
2221+ physical_disk : my_zpool. physical_disk_id ( ) . to_string ( ) ,
22232222 } ) ;
22242223 }
22252224
@@ -2311,7 +2310,7 @@ async fn cmd_db_disk_physical(
23112310 }
23122311
23132312 let datasets = query
2314- . filter ( dataset_dsl:: pool_id. eq ( zp. id ( ) ) )
2313+ . filter ( dataset_dsl:: pool_id. eq ( to_db_typed_uuid ( zp. id ( ) ) ) )
23152314 . select ( CrucibleDataset :: as_select ( ) )
23162315 . load_async ( & * conn)
23172316 . await
@@ -2739,7 +2738,7 @@ async fn cmd_db_snapshot_info(
27392738 } else {
27402739 let mut rows = Vec :: with_capacity ( 3 ) ;
27412740 for ( dataset, region) in regions {
2742- let my_pool_id = dataset. pool_id ;
2741+ let my_pool_id = dataset. pool_id ( ) ;
27432742 let ( _, my_zpool) = LookupPath :: new ( opctx, datastore)
27442743 . zpool_id ( my_pool_id)
27452744 . fetch ( )
@@ -2758,7 +2757,7 @@ async fn cmd_db_snapshot_info(
27582757 host_serial : my_sled. serial_number ( ) . to_string ( ) ,
27592758 region : region. id ( ) . to_string ( ) ,
27602759 dataset : dataset. id ( ) . to_string ( ) ,
2761- physical_disk : my_zpool. physical_disk_id . to_string ( ) ,
2760+ physical_disk : my_zpool. physical_disk_id ( ) . to_string ( ) ,
27622761 } ) ;
27632762 }
27642763
@@ -2779,7 +2778,7 @@ async fn cmd_db_snapshot_info(
27792778
27802779 let mut rows = Vec :: with_capacity ( 3 ) ;
27812780 for ( dataset, region) in regions {
2782- let my_pool_id = dataset. pool_id ;
2781+ let my_pool_id = dataset. pool_id ( ) ;
27832782 let ( _, my_zpool) = LookupPath :: new ( opctx, datastore)
27842783 . zpool_id ( my_pool_id)
27852784 . fetch ( )
@@ -2798,7 +2797,7 @@ async fn cmd_db_snapshot_info(
27982797 host_serial : my_sled. serial_number ( ) . to_string ( ) ,
27992798 region : region. id ( ) . to_string ( ) ,
28002799 dataset : dataset. id ( ) . to_string ( ) ,
2801- physical_disk : my_zpool. physical_disk_id . to_string ( ) ,
2800+ physical_disk : my_zpool. physical_disk_id ( ) . to_string ( ) ,
28022801 } ) ;
28032802 }
28042803
@@ -3832,7 +3831,7 @@ async fn cmd_db_dry_run_region_allocation(
38323831 pub dataset_id : DatasetUuid ,
38333832 pub size_used : i64 ,
38343833
3835- pub pool_id : Uuid ,
3834+ pub pool_id : ZpoolUuid ,
38363835
38373836 #[ tabled( display_with = "option_impl_display" ) ]
38383837 pub total_size : Option < i64 > ,
@@ -3852,17 +3851,16 @@ async fn cmd_db_dry_run_region_allocation(
38523851 ) ;
38533852 } ;
38543853
3855- let mut zpool_total_size: HashMap < Uuid , i64 > = HashMap :: new ( ) ;
3854+ let mut zpool_total_size: HashMap < ZpoolUuid , i64 > = HashMap :: new ( ) ;
38563855
38573856 for sled_agent in latest_collection. sled_agents {
38583857 for zpool in sled_agent. zpools {
3859- zpool_total_size
3860- . insert ( zpool. id . into_untyped_uuid ( ) , zpool. total_size . into ( ) ) ;
3858+ zpool_total_size. insert ( zpool. id , zpool. total_size . into ( ) ) ;
38613859 }
38623860 }
38633861
38643862 for ( dataset, region) in datasets_and_regions {
3865- let pool_id = dataset. pool_id . into_untyped_uuid ( ) ;
3863+ let pool_id = dataset. pool_id ( ) ;
38663864 let total_size = zpool_total_size. get ( & pool_id) ;
38673865 rows. push ( Row {
38683866 region_id : region. id ( ) ,
@@ -7700,19 +7698,18 @@ async fn cmd_db_zpool_list(
77007698 bail ! ( "no latest inventory found!" ) ;
77017699 } ;
77027700
7703- let mut zpool_total_size: HashMap < Uuid , i64 > = HashMap :: new ( ) ;
7701+ let mut zpool_total_size: HashMap < ZpoolUuid , i64 > = HashMap :: new ( ) ;
77047702
77057703 for sled_agent in latest_collection. sled_agents {
77067704 for zpool in sled_agent. zpools {
7707- zpool_total_size
7708- . insert ( zpool. id . into_untyped_uuid ( ) , zpool. total_size . into ( ) ) ;
7705+ zpool_total_size. insert ( zpool. id , zpool. total_size . into ( ) ) ;
77097706 }
77107707 }
77117708
77127709 #[ derive( Tabled ) ]
77137710 #[ tabled( rename_all = "SCREAMING_SNAKE_CASE" ) ]
77147711 struct ZpoolRow {
7715- id : Uuid ,
7712+ id : ZpoolUuid ,
77167713 time_deleted : String ,
77177714 sled_id : SledUuid ,
77187715 physical_disk_id : PhysicalDiskUuid ,
@@ -7724,7 +7721,7 @@ async fn cmd_db_zpool_list(
77247721 let rows: Vec < ZpoolRow > = zpools
77257722 . into_iter ( )
77267723 . map ( |( p, _) | {
7727- let zpool_id = p. id ( ) . into_untyped_uuid ( ) ;
7724+ let zpool_id = p. id ( ) ;
77287725 Ok ( ZpoolRow {
77297726 id : zpool_id,
77307727 time_deleted : match p. time_deleted ( ) {
0 commit comments