@@ -3331,6 +3331,7 @@ spa_load(spa_t *spa, spa_load_state_t state, spa_import_type_t type)
3331
3331
spa -> spa_load_state = state ;
3332
3332
(void ) spa_import_progress_set_state (spa_guid (spa ),
3333
3333
spa_load_state (spa ));
3334
+ spa_import_progress_set_notes (spa , "spa_load()" );
3334
3335
3335
3336
gethrestime (& spa -> spa_loaded_ts );
3336
3337
error = spa_load_impl (spa , type , & ereport );
@@ -3551,7 +3552,7 @@ spa_activity_check(spa_t *spa, uberblock_t *ub, nvlist_t *config)
3551
3552
uint64_t mmp_config = ub -> ub_mmp_config ;
3552
3553
uint16_t mmp_seq = MMP_SEQ_VALID (ub ) ? MMP_SEQ (ub ) : 0 ;
3553
3554
uint64_t import_delay ;
3554
- hrtime_t import_expire ;
3555
+ hrtime_t import_expire , now ;
3555
3556
nvlist_t * mmp_label = NULL ;
3556
3557
vdev_t * rvd = spa -> spa_root_vdev ;
3557
3558
kcondvar_t cv ;
@@ -3589,7 +3590,17 @@ spa_activity_check(spa_t *spa, uberblock_t *ub, nvlist_t *config)
3589
3590
3590
3591
import_expire = gethrtime () + import_delay ;
3591
3592
3592
- while (gethrtime () < import_expire ) {
3593
+ spa_import_progress_set_notes (spa , "Checking MMP activity, waiting "
3594
+ "%llu ms" , (u_longlong_t )NSEC2MSEC (import_delay ));
3595
+
3596
+ int interations = 0 ;
3597
+ while ((now = gethrtime ()) < import_expire ) {
3598
+ if (interations ++ % 30 == 0 ) {
3599
+ spa_import_progress_set_notes (spa , "Checking MMP "
3600
+ "activity, %llu ms remaining" ,
3601
+ (u_longlong_t )NSEC2MSEC (import_expire - now ));
3602
+ }
3603
+
3593
3604
(void ) spa_import_progress_set_mmp_check (spa_guid (spa ),
3594
3605
NSEC2SEC (import_expire - gethrtime ()));
3595
3606
@@ -5188,6 +5199,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5188
5199
/*
5189
5200
* Retrieve the checkpoint txg if the pool has a checkpoint.
5190
5201
*/
5202
+ spa_import_progress_set_notes (spa , "Loading checkpoint txg" );
5191
5203
error = spa_ld_read_checkpoint_txg (spa );
5192
5204
if (error != 0 )
5193
5205
return (error );
@@ -5200,6 +5212,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5200
5212
* initiated. Otherwise we could be reading from indirect vdevs before
5201
5213
* we have loaded their mappings.
5202
5214
*/
5215
+ spa_import_progress_set_notes (spa , "Loading indirect vdev metadata" );
5203
5216
error = spa_ld_open_indirect_vdev_metadata (spa );
5204
5217
if (error != 0 )
5205
5218
return (error );
@@ -5208,6 +5221,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5208
5221
* Retrieve the full list of active features from the MOS and check if
5209
5222
* they are all supported.
5210
5223
*/
5224
+ spa_import_progress_set_notes (spa , "Checking feature flags" );
5211
5225
error = spa_ld_check_features (spa , & missing_feat_write );
5212
5226
if (error != 0 )
5213
5227
return (error );
@@ -5216,13 +5230,15 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5216
5230
* Load several special directories from the MOS needed by the dsl_pool
5217
5231
* layer.
5218
5232
*/
5233
+ spa_import_progress_set_notes (spa , "Loading special MOS directories" );
5219
5234
error = spa_ld_load_special_directories (spa );
5220
5235
if (error != 0 )
5221
5236
return (error );
5222
5237
5223
5238
/*
5224
5239
* Retrieve pool properties from the MOS.
5225
5240
*/
5241
+ spa_import_progress_set_notes (spa , "Loading properties" );
5226
5242
error = spa_ld_get_props (spa );
5227
5243
if (error != 0 )
5228
5244
return (error );
@@ -5231,6 +5247,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5231
5247
* Retrieve the list of auxiliary devices - cache devices and spares -
5232
5248
* and open them.
5233
5249
*/
5250
+ spa_import_progress_set_notes (spa , "Loading AUX vdevs" );
5234
5251
error = spa_ld_open_aux_vdevs (spa , type );
5235
5252
if (error != 0 )
5236
5253
return (error );
@@ -5239,10 +5256,12 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5239
5256
* Load the metadata for all vdevs. Also check if unopenable devices
5240
5257
* should be autoreplaced.
5241
5258
*/
5259
+ spa_import_progress_set_notes (spa , "Loading vdev metadata" );
5242
5260
error = spa_ld_load_vdev_metadata (spa );
5243
5261
if (error != 0 )
5244
5262
return (error );
5245
5263
5264
+ spa_import_progress_set_notes (spa , "Loading dedup tables" );
5246
5265
error = spa_ld_load_dedup_tables (spa );
5247
5266
if (error != 0 )
5248
5267
return (error );
@@ -5251,6 +5270,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5251
5270
* Verify the logs now to make sure we don't have any unexpected errors
5252
5271
* when we claim log blocks later.
5253
5272
*/
5273
+ spa_import_progress_set_notes (spa , "Verifying Log Devices" );
5254
5274
error = spa_ld_verify_logs (spa , type , ereport );
5255
5275
if (error != 0 )
5256
5276
return (error );
@@ -5272,6 +5292,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5272
5292
* state. When performing an extreme rewind, we verify the whole pool,
5273
5293
* which can take a very long time.
5274
5294
*/
5295
+ spa_import_progress_set_notes (spa , "Verifying pool data" );
5275
5296
error = spa_ld_verify_pool_data (spa );
5276
5297
if (error != 0 )
5277
5298
return (error );
@@ -5281,13 +5302,15 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5281
5302
* we write anything to the pool because we'd need to update the space
5282
5303
* accounting using the deflated sizes.
5283
5304
*/
5305
+ spa_import_progress_set_notes (spa , "Calculating deflated space" );
5284
5306
spa_update_dspace (spa );
5285
5307
5286
5308
/*
5287
5309
* We have now retrieved all the information we needed to open the
5288
5310
* pool. If we are importing the pool in read-write mode, a few
5289
5311
* additional steps must be performed to finish the import.
5290
5312
*/
5313
+ spa_import_progress_set_notes (spa , "Starting import" );
5291
5314
if (spa_writeable (spa ) && (spa -> spa_load_state == SPA_LOAD_RECOVER ||
5292
5315
spa -> spa_load_max_txg == UINT64_MAX )) {
5293
5316
uint64_t config_cache_txg = spa -> spa_config_txg ;
@@ -5304,6 +5327,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5304
5327
(u_longlong_t )spa -> spa_uberblock .ub_checkpoint_txg );
5305
5328
}
5306
5329
5330
+ spa_import_progress_set_notes (spa , "Claiming ZIL blocks" );
5307
5331
/*
5308
5332
* Traverse the ZIL and claim all blocks.
5309
5333
*/
@@ -5323,13 +5347,15 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5323
5347
* will have been set for us by ZIL traversal operations
5324
5348
* performed above.
5325
5349
*/
5350
+ spa_import_progress_set_notes (spa , "Syncing ZIL claims" );
5326
5351
txg_wait_synced (spa -> spa_dsl_pool , spa -> spa_claim_max_txg );
5327
5352
5328
5353
/*
5329
5354
* Check if we need to request an update of the config. On the
5330
5355
* next sync, we would update the config stored in vdev labels
5331
5356
* and the cachefile (by default /etc/zfs/zpool.cache).
5332
5357
*/
5358
+ spa_import_progress_set_notes (spa , "Updating configs" );
5333
5359
spa_ld_check_for_config_update (spa , config_cache_txg ,
5334
5360
update_config_cache );
5335
5361
@@ -5338,6 +5364,7 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5338
5364
* Then check all DTLs to see if anything needs resilvering.
5339
5365
* The resilver will be deferred if a rebuild was started.
5340
5366
*/
5367
+ spa_import_progress_set_notes (spa , "Starting resilvers" );
5341
5368
if (vdev_rebuild_active (spa -> spa_root_vdev )) {
5342
5369
vdev_rebuild_restart (spa );
5343
5370
} else if (!dsl_scan_resilvering (spa -> spa_dsl_pool ) &&
@@ -5351,6 +5378,8 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5351
5378
*/
5352
5379
spa_history_log_version (spa , "open" , NULL );
5353
5380
5381
+ spa_import_progress_set_notes (spa ,
5382
+ "Restarting device removals" );
5354
5383
spa_restart_removal (spa );
5355
5384
spa_spawn_aux_threads (spa );
5356
5385
@@ -5363,19 +5392,26 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
5363
5392
* auxiliary threads above (from which the livelist
5364
5393
* deletion zthr is part of).
5365
5394
*/
5395
+ spa_import_progress_set_notes (spa ,
5396
+ "Cleaning up inconsistent objsets" );
5366
5397
(void ) dmu_objset_find (spa_name (spa ),
5367
5398
dsl_destroy_inconsistent , NULL , DS_FIND_CHILDREN );
5368
5399
5369
5400
/*
5370
5401
* Clean up any stale temporary dataset userrefs.
5371
5402
*/
5403
+ spa_import_progress_set_notes (spa ,
5404
+ "Cleaning up temporary userrefs" );
5372
5405
dsl_pool_clean_tmp_userrefs (spa -> spa_dsl_pool );
5373
5406
5374
5407
spa_config_enter (spa , SCL_CONFIG , FTAG , RW_READER );
5408
+ spa_import_progress_set_notes (spa , "Restarting initialize" );
5375
5409
vdev_initialize_restart (spa -> spa_root_vdev );
5410
+ spa_import_progress_set_notes (spa , "Restarting TRIM" );
5376
5411
vdev_trim_restart (spa -> spa_root_vdev );
5377
5412
vdev_autotrim_restart (spa );
5378
5413
spa_config_exit (spa , SCL_CONFIG , FTAG );
5414
+ spa_import_progress_set_notes (spa , "Finished importing" );
5379
5415
}
5380
5416
5381
5417
spa_import_progress_remove (spa_guid (spa ));
0 commit comments