Skip to content

Commit

Permalink
Changes to improve zpool clear after mmp suspend
Browse files Browse the repository at this point in the history
Signed-off-by: Don Brady <[email protected]>
  • Loading branch information
don-brady committed Apr 25, 2024
1 parent 1fe8c17 commit ce6902a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 5 additions & 8 deletions module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ uint64_t zfs_max_missing_tvds_cachefile = SPA_DVAS_PER_BP - 1;
uint64_t zfs_max_missing_tvds_scan = 0;

/*
* Debugging aid that pauses spa_sync() towards the end.
* Debugginr aid that pauses spa_sync() towards the end.
*/
static const boolean_t zfs_pause_spa_sync = B_FALSE;

Expand Down Expand Up @@ -3759,8 +3759,6 @@ spa_mmp_remote_host_activity(spa_t *spa)

nvlist_t *best_label;
uberblock_t best_ub;
uberblock_t *spa_ub = &spa->spa_uberblock;
uint16_t spa_mmp_seq = MMP_SEQ_VALID(spa_ub) ? MMP_SEQ(spa_ub) : 0;

/*
* Locate the best uberblock on disk
Expand All @@ -3787,14 +3785,13 @@ spa_mmp_remote_host_activity(spa_t *spa)
return (B_TRUE);
}

/*
* confirm that the best sequence is still from our host
*/
if (spa_mmp_seq != (MMP_SEQ_VALID(&best_ub) ? MMP_SEQ(&best_ub) : 0))
if (best_ub.ub_txg != spa->spa_uberblock.ub_txg ||
best_ub.ub_timestamp != spa->spa_uberblock.ub_timestamp) {
return (B_TRUE);
}

/*
* Finally perform an activity check looking for any remote writer
* Perform an activity check looking for any remote writer
*/
return (spa_activity_check(spa, &spa->spa_uberblock, spa->spa_config,
B_FALSE) != 0);
Expand Down
9 changes: 9 additions & 0 deletions module/zfs/txg.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,15 @@ txg_sync_thread(void *arg)
timer = (delta > timeout ? 0 : timeout - delta);
}

/*
* When we're suspended, nothing should be changing and for
* MMP we don't want to bump anything that would make it
* harder to detect if another host is changing it when
* resuming after a MMP suspend.
*/
if (spa_suspended(spa))
continue;

/*
* Wait until the quiesce thread hands off a txg to us,
* prompting it to do so if necessary.
Expand Down

0 comments on commit ce6902a

Please sign in to comment.