@@ -3109,6 +3109,7 @@ spa_load(spa_t *spa, spa_load_state_t state, spa_import_type_t type)
3109
3109
spa -> spa_load_state = state ;
3110
3110
(void ) spa_import_progress_set_state (spa_guid (spa ),
3111
3111
spa_load_state (spa ));
3112
+ spa_import_progress_set_notes (spa , "spa_load()" );
3112
3113
3113
3114
gethrestime (& spa -> spa_loaded_ts );
3114
3115
error = spa_load_impl (spa , type , & ereport );
@@ -3375,6 +3376,12 @@ spa_activity_check(spa_t *spa, uberblock_t *ub, nvlist_t *config)
3375
3376
3376
3377
import_expire = gethrtime () + import_delay ;
3377
3378
3379
+ char buf [128 ];
3380
+ (void ) snprintf (buf , sizeof (buf ), "Checking MMP activity, waiting "
3381
+ "%llu ms" , (u_longlong_t )NSEC2MSEC (import_delay ));
3382
+ spa_import_progress_set_notes (spa , buf );
3383
+
3384
+ int interations = 0 ;
3378
3385
while (gethrtime () < import_expire ) {
3379
3386
(void ) spa_import_progress_set_mmp_check (spa_guid (spa ),
3380
3387
NSEC2SEC (import_expire - gethrtime ()));
@@ -3408,6 +3415,14 @@ spa_activity_check(spa_t *spa, uberblock_t *ub, nvlist_t *config)
3408
3415
break ;
3409
3416
}
3410
3417
error = 0 ;
3418
+
3419
+ if (interations ++ % 30 == 0 && import_expire > gethrtime ()) {
3420
+ uint64_t remaining = import_expire - gethrtime ();
3421
+ (void ) snprintf (buf , sizeof (buf ), "Checking MMP "
3422
+ "activity, %llu ms remaining" ,
3423
+ (u_longlong_t )remaining );
3424
+ spa_import_progress_set_notes (spa , buf );
3425
+ }
3411
3426
}
3412
3427
3413
3428
out :
@@ -4995,6 +5010,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
4995
5010
/*
4996
5011
* Retrieve the checkpoint txg if the pool has a checkpoint.
4997
5012
*/
5013
+ spa_import_progress_set_notes (spa , "Loading checkpoint txg" );
4998
5014
error = spa_ld_read_checkpoint_txg (spa );
4999
5015
if (error != 0 )
5000
5016
return (error );
@@ -5007,6 +5023,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5007
5023
* initiated. Otherwise we could be reading from indirect vdevs before
5008
5024
* we have loaded their mappings.
5009
5025
*/
5026
+ spa_import_progress_set_notes (spa , "Loading indirect vdev metadata" );
5010
5027
error = spa_ld_open_indirect_vdev_metadata (spa );
5011
5028
if (error != 0 )
5012
5029
return (error );
@@ -5015,6 +5032,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5015
5032
* Retrieve the full list of active features from the MOS and check if
5016
5033
* they are all supported.
5017
5034
*/
5035
+ spa_import_progress_set_notes (spa , "Checking feature flags" );
5018
5036
error = spa_ld_check_features (spa , & missing_feat_write );
5019
5037
if (error != 0 )
5020
5038
return (error );
@@ -5023,13 +5041,15 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5023
5041
* Load several special directories from the MOS needed by the dsl_pool
5024
5042
* layer.
5025
5043
*/
5044
+ spa_import_progress_set_notes (spa , "Loading special MOS directories" );
5026
5045
error = spa_ld_load_special_directories (spa );
5027
5046
if (error != 0 )
5028
5047
return (error );
5029
5048
5030
5049
/*
5031
5050
* Retrieve pool properties from the MOS.
5032
5051
*/
5052
+ spa_import_progress_set_notes (spa , "Loading properties" );
5033
5053
error = spa_ld_get_props (spa );
5034
5054
if (error != 0 )
5035
5055
return (error );
@@ -5038,6 +5058,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5038
5058
* Retrieve the list of auxiliary devices - cache devices and spares -
5039
5059
* and open them.
5040
5060
*/
5061
+ spa_import_progress_set_notes (spa , "Loading AUX vdevs" );
5041
5062
error = spa_ld_open_aux_vdevs (spa , type );
5042
5063
if (error != 0 )
5043
5064
return (error );
@@ -5046,14 +5067,17 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5046
5067
* Load the metadata for all vdevs. Also check if unopenable devices
5047
5068
* should be autoreplaced.
5048
5069
*/
5070
+ spa_import_progress_set_notes (spa , "Loading vdev metadata" );
5049
5071
error = spa_ld_load_vdev_metadata (spa );
5050
5072
if (error != 0 )
5051
5073
return (error );
5052
5074
5075
+ spa_import_progress_set_notes (spa , "Loading dedup tables" );
5053
5076
error = spa_ld_load_dedup_tables (spa );
5054
5077
if (error != 0 )
5055
5078
return (error );
5056
5079
5080
+ spa_import_progress_set_notes (spa , "Loading BRT" );
5057
5081
error = spa_ld_load_brt (spa );
5058
5082
if (error != 0 )
5059
5083
return (error );
@@ -5062,6 +5086,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5062
5086
* Verify the logs now to make sure we don't have any unexpected errors
5063
5087
* when we claim log blocks later.
5064
5088
*/
5089
+ spa_import_progress_set_notes (spa , "Verifying Log Devices" );
5065
5090
error = spa_ld_verify_logs (spa , type , ereport );
5066
5091
if (error != 0 )
5067
5092
return (error );
@@ -5083,6 +5108,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5083
5108
* state. When performing an extreme rewind, we verify the whole pool,
5084
5109
* which can take a very long time.
5085
5110
*/
5111
+ spa_import_progress_set_notes (spa , "Verifying pool data" );
5086
5112
error = spa_ld_verify_pool_data (spa );
5087
5113
if (error != 0 )
5088
5114
return (error );
@@ -5092,13 +5118,15 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5092
5118
* we write anything to the pool because we'd need to update the space
5093
5119
* accounting using the deflated sizes.
5094
5120
*/
5121
+ spa_import_progress_set_notes (spa , "Calculating deflated space" );
5095
5122
spa_update_dspace (spa );
5096
5123
5097
5124
/*
5098
5125
* We have now retrieved all the information we needed to open the
5099
5126
* pool. If we are importing the pool in read-write mode, a few
5100
5127
* additional steps must be performed to finish the import.
5101
5128
*/
5129
+ spa_import_progress_set_notes (spa , "Starting import" );
5102
5130
if (spa_writeable (spa ) && (spa -> spa_load_state == SPA_LOAD_RECOVER ||
5103
5131
spa -> spa_load_max_txg == UINT64_MAX )) {
5104
5132
uint64_t config_cache_txg = spa -> spa_config_txg ;
@@ -5122,6 +5150,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5122
5150
(u_longlong_t )spa -> spa_uberblock .ub_checkpoint_txg );
5123
5151
}
5124
5152
5153
+ spa_import_progress_set_notes (spa , "Claiming ZIL blocks" );
5125
5154
/*
5126
5155
* Traverse the ZIL and claim all blocks.
5127
5156
*/
@@ -5141,13 +5170,15 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5141
5170
* will have been set for us by ZIL traversal operations
5142
5171
* performed above.
5143
5172
*/
5173
+ spa_import_progress_set_notes (spa , "Syncing ZIL claims" );
5144
5174
txg_wait_synced (spa -> spa_dsl_pool , spa -> spa_claim_max_txg );
5145
5175
5146
5176
/*
5147
5177
* Check if we need to request an update of the config. On the
5148
5178
* next sync, we would update the config stored in vdev labels
5149
5179
* and the cachefile (by default /etc/zfs/zpool.cache).
5150
5180
*/
5181
+ spa_import_progress_set_notes (spa , "Updating configs" );
5151
5182
spa_ld_check_for_config_update (spa , config_cache_txg ,
5152
5183
update_config_cache );
5153
5184
@@ -5156,6 +5187,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5156
5187
* Then check all DTLs to see if anything needs resilvering.
5157
5188
* The resilver will be deferred if a rebuild was started.
5158
5189
*/
5190
+ spa_import_progress_set_notes (spa , "Starting resilvers" );
5159
5191
if (vdev_rebuild_active (spa -> spa_root_vdev )) {
5160
5192
vdev_rebuild_restart (spa );
5161
5193
} else if (!dsl_scan_resilvering (spa -> spa_dsl_pool ) &&
@@ -5169,6 +5201,8 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5169
5201
*/
5170
5202
spa_history_log_version (spa , "open" , NULL );
5171
5203
5204
+ spa_import_progress_set_notes (spa ,
5205
+ "Restarting device removals" );
5172
5206
spa_restart_removal (spa );
5173
5207
spa_spawn_aux_threads (spa );
5174
5208
@@ -5181,19 +5215,26 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, const char **ereport)
5181
5215
* auxiliary threads above (from which the livelist
5182
5216
* deletion zthr is part of).
5183
5217
*/
5218
+ spa_import_progress_set_notes (spa ,
5219
+ "Cleaning up inconsistent objsets" );
5184
5220
(void ) dmu_objset_find (spa_name (spa ),
5185
5221
dsl_destroy_inconsistent , NULL , DS_FIND_CHILDREN );
5186
5222
5187
5223
/*
5188
5224
* Clean up any stale temporary dataset userrefs.
5189
5225
*/
5226
+ spa_import_progress_set_notes (spa ,
5227
+ "Cleaning up temporary userrefs" );
5190
5228
dsl_pool_clean_tmp_userrefs (spa -> spa_dsl_pool );
5191
5229
5192
5230
spa_config_enter (spa , SCL_CONFIG , FTAG , RW_READER );
5231
+ spa_import_progress_set_notes (spa , "Restarting initialize" );
5193
5232
vdev_initialize_restart (spa -> spa_root_vdev );
5233
+ spa_import_progress_set_notes (spa , "Restarting TRIM" );
5194
5234
vdev_trim_restart (spa -> spa_root_vdev );
5195
5235
vdev_autotrim_restart (spa );
5196
5236
spa_config_exit (spa , SCL_CONFIG , FTAG );
5237
+ spa_import_progress_set_notes (spa , "Finished importing" );
5197
5238
}
5198
5239
5199
5240
spa_import_progress_remove (spa_guid (spa ));
0 commit comments