Skip to content

Commit

Permalink
OpenZFS 8373 - TXG_WAIT in ZIL commit path
Browse files Browse the repository at this point in the history
Authored by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/8373
OpenZFS-commit: openzfs/openzfs@7f04961
Closes openzfs#6403
  • Loading branch information
avg-I authored and FransUrbo committed Apr 28, 2019
1 parent a8c2b7e commit 779de63
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions module/zfs/zil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,13 +1011,22 @@ zil_lwb_write_start(zilog_t *zilog, lwb_t *lwb)
tx = dmu_tx_create(zilog->zl_os);

/*
* Since we are not going to create any new dirty data, and we
* can even help with clearing the existing dirty data, we
* should not be subject to the dirty data based delays. We
* use TXG_NOTHROTTLE to bypass the delay mechanism.
* Since we are not going to create any new dirty data and we can even
* help with clearing the existing dirty data, we should not be subject
* to the dirty data based delays.
* We (ab)use TXG_WAITED to bypass the delay mechanism.
* One side effect from using TXG_WAITED is that dmu_tx_assign() can
* fail if the pool is suspended. Those are dramatic circumstances,
* so we return NULL to signal that the normal ZIL processing is not
* possible and txg_wait_synced() should be used to ensure that the data
* is on disk.
*/
VERIFY0(dmu_tx_assign(tx, TXG_WAIT | TXG_NOTHROTTLE));

error = dmu_tx_assign(tx, TXG_WAITED);
if (error != 0) {
ASSERT3S(error, ==, EIO);
dmu_tx_abort(tx);
return (NULL);
}
dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
txg = dmu_tx_get_txg(tx);

Expand Down

0 comments on commit 779de63

Please sign in to comment.