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