Project

General

Profile

Bug #3909

"zfs send -D" does not work

Added by Matthew Ahrens over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2013-07-25
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

As reported on the zfs@illumos mailing list:

The send completes (if piped to receive, the receive finishes OK), but the sending process hangs. It should be easy to reproduce:

  1. zfs create zones/one
  2. zfs snapshot zones/one@test
  3. zfs send zones/one@test | zfs receive -v zones/two
    receiving full stream of zones/one@test into zones/two@test
    received 46.3KB stream in 1 seconds (46.3KB/sec)
  4. zfs destroy -r zones/two
  5. zfs send -D zones/one@test | zfs receive -v zones/two
    receiving full stream of zones/one@test into zones/two@test
    received 46.3KB stream in 1 seconds (46.3KB/sec)
    ^C
    Hung!

The problem is that zfs_send() is calling pthread_join() before closing the pipe. The workaround of hitting ^C when it's done should work (at least in this simple case). This bug was introduced by the following commit:

Branch: refs/heads/master
Home: https://github.com/illumos/illumos-gate
Commit: a7a845e4bf22fd1b2a284729ccd95c7370a0438c
https://github.com/illumos/illumos-gate/commit/a7a845e4bf22fd1b2a284729ccd95c7370a0438c
Author: Steven Hartland <>
Date: 2013-06-11 (Tue, 11 Jun 2013)

Changed paths:
M usr/src/cmd/ndmpd/ndmp/ndmpd_chkpnt.c
M usr/src/cmd/zfs/zfs_main.c
M usr/src/cmd/zhack/zhack.c
M usr/src/cmd/ztest/ztest.c
M usr/src/lib/libzfs/common/libzfs.h
M usr/src/lib/libzfs/common/libzfs_dataset.c
M usr/src/lib/libzfs/common/libzfs_sendrecv.c
M usr/src/lib/libzfs_core/common/libzfs_core.c
M usr/src/uts/common/fs/zfs/dsl_destroy.c
M usr/src/uts/common/fs/zfs/dsl_pool.c
M usr/src/uts/common/fs/zfs/dsl_userhold.c
M usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
M usr/src/uts/common/fs/zfs/sys/dsl_userhold.h
M usr/src/uts/common/fs/zfs/zfs_ioctl.c
Log Message:
-----------
3740 Poor ZFS send / receive performance due to snapshot hold / release processing
Reviewed by: Matthew Ahrens &lt;&gt;
Approved by: Christopher Siden &lt;&gt;

History

#1

Updated by Christopher Siden over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed
commit 36f7455
Author: Steven Hartland <smh@freebsd.org>
Date:   Mon Jul 29 12:36:31 2013

    3909 "zfs send -D" does not work
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Approved by: Christopher Siden <christopher.siden@delphix.com>

Also available in: Atom PDF