Print this page
2605 want to resume interrupted zfs send
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@omniti.com>
4206 history_003_pos relies on exact size of history log and entries
4207 history_008_pos depends on obsolete internal history log message
4208 Typo in zfs_main.c: "posxiuser"
4209 Populate zfstest with the remainder of the STF tests
Reviewed by: Sonu Pillai <sonu.pillai@delphix.com>
Reviewed by: Will Guyette <will.guyette@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/test/zfs-tests/tests/functional/rsend/rsend.kshlib
          +++ new/usr/src/test/zfs-tests/tests/functional/rsend/rsend.kshlib
↓ open down ↓ 504 lines elided ↑ open up ↑
 505  505  #
 506  506  # Setup filesystems for the resumable send/receive tests
 507  507  #
 508  508  # $1 The "send" filesystem
 509  509  # $2 The "recv" filesystem
 510  510  #
 511  511  function test_fs_setup
 512  512  {
 513  513          typeset sendfs=$1
 514  514          typeset recvfs=$2
 515      -        typeset streamfs=$3
 516  515          typeset sendpool=${sendfs%%/*}
 517  516          typeset recvpool=${recvfs%%/*}
 518  517  
 519  518          datasetexists $sendfs && log_must zfs destroy -r $sendpool
 520  519          datasetexists $recvfs && log_must zfs destroy -r $recvpool
 521      -        datasetexists $streamfs && log_must zfs destroy -r $streamfs
 522  520  
 523  521          if $(datasetexists $sendfs || zfs create -o compress=lz4 $sendfs); then
 524  522                  mk_files 1000 256 0 $sendfs &
 525  523                  mk_files 1000 131072 0 $sendfs &
 526  524                  mk_files 100 1048576 0 $sendfs &
 527  525                  mk_files 10 10485760 0 $sendfs &
 528  526                  mk_files 1 104857600 0 $sendfs &
 529  527                  log_must wait
 530  528                  log_must zfs snapshot $sendfs@a
 531  529  
↓ open down ↓ 8 lines elided ↑ open up ↑
 540  538                  mk_files 40 1048576 0 $sendfs &
 541  539                  mk_files 4 10485760 0 $sendfs &
 542  540                  log_must wait
 543  541  
 544  542                  log_must zfs snapshot $sendfs@b
 545  543                  log_must eval "zfs send -v $sendfs@a >/$sendpool/initial.zsend"
 546  544                  log_must eval "zfs send -v -i @a $sendfs@b " \
 547  545                      ">/$sendpool/incremental.zsend"
 548  546          fi
 549  547  
 550      -        log_must zfs create -o compress=lz4 $streamfs
      548 +        if datasetexists $streamfs; then
      549 +                log_must zfs destroy -r $streamfs
      550 +        fi
      551 +        log_must zfs create -o compress=lz4 $sendpool/stream
 551  552  }
 552  553  
 553  554  #
 554  555  # Check to see if the specified features are set in a send stream.
 555  556  # The values for these features are found in uts/common/fs/zfs/sys/zfs_ioctl.h
 556  557  #
 557  558  # $1 The stream file
 558  559  # $2-$n The flags expected in the stream
 559  560  #
 560  561  function stream_has_features
↓ open down ↓ 92 lines elided ↑ open up ↑
 653  654  
 654  655          within_percent $stream_size $ds_size $percent || log_fail \
 655  656              "$stream_size $ds_size differed by too much"
 656  657  }
 657  658  
 658  659  # Cleanup function for tests involving resumable send
 659  660  function resume_cleanup
 660  661  {
 661  662          typeset sendfs=$1
 662  663          typeset streamfs=$2
 663      -        typeset sendpool=${sendfs%%/*}
 664  664  
 665  665          datasetexists $sendfs && log_must zfs destroy -r $sendfs
 666  666          datasetexists $streamfs && log_must zfs destroy -r $streamfs
 667  667          cleanup_pool $POOL2
 668      -        rm -f /$sendpool/initial.zsend /$sendpool/incremental.zsend
      668 +        rm -f /$POOL/initial.zsend /$POOL/incremental.zsend
 669  669  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX