EBS snapshot backups from a FreeBSD zfs file system: zpool freeze?

Berend de Boer berend at pobox.com
Thu Jul 4 00:55:41 UTC 2013


>>>>> "Steven" == Steven Hartland <killing at multiplay.co.uk> writes:

    Steven> Not been following the thread really so excuse if this has
    Steven> already been mentioned ;-)

Not yet.


    Steven> There is a zpool freeze <pool> which stops spa_sync() from
    Steven> doing anything, so that the only way to record changes is
    Steven> on the ZIL.

Pardon my ignorance, I don't really understand this. First of all, is
there a way to recover from a freeze? I.e. do I need to unfreeze?

What you're saying is that it is a one way street only? I just did
this on my semi-production server to see what is going to
happen. Nothing so far.

I had a look at the code, this is what it calls:

  static int
  zfs_ioc_pool_freeze(zfs_cmd_t *zc)
  {
    spa_t *spa;
    int error;

    error = spa_open(zc->zc_name, &spa, FTAG);
    if (error == 0) {
      spa_freeze(spa);
      spa_close(spa, FTAG);
    }
    return (error);
  }

And spa_freeze is this:

  void
  spa_freeze(spa_t *spa)
  {
    uint64_t freeze_txg = 0;

    spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
    if (spa->spa_freeze_txg == UINT64_MAX) {
      freeze_txg = spa_last_synced_txg(spa) + TXG_SIZE;
      spa->spa_freeze_txg = freeze_txg;
    }
    spa_config_exit(spa, SCL_ALL, FTAG);
    if (freeze_txg != 0)
      txg_wait_synced(spa_get_dsl(spa), freeze_txg);
  }

All nicely undocumented code.


    Steven> The comment in the zpool_main is: "'freeze' is a vile
    Steven> debugging abomination" so it's evil but might be what you
    Steven> want if you're up to writing some code.

Yeah!

But thanks for digging this up, I hadn't expected undocumented
commands for zpool!


    Steven> For more info have a look at ztest.

Another undocumented tool. How would I use this in this case?

--
All the best,

Berend de Boer


          ------------------------------------------------------
          Awesome Drupal hosting: https://www.xplainhosting.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20130704/7c4d372d/attachment.sig>


More information about the freebsd-fs mailing list