From owner-freebsd-fs@freebsd.org Mon Jun 13 14:35:43 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844EAAF18CF for ; Mon, 13 Jun 2016 14:35:43 +0000 (UTC) (envelope-from pawan@cloudbyte.com) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C29D2794 for ; Mon, 13 Jun 2016 14:35:43 +0000 (UTC) (envelope-from pawan@cloudbyte.com) Received: by mail-yw0-x22f.google.com with SMTP id g20so127540260ywb.0 for ; Mon, 13 Jun 2016 07:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudbyte-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=Nk3svj1pJwXgIjjAVC+MCxRt+kavEJsVSTU3kUUMlKQ=; b=i5W7k0ZW4TsdZlKAAKQ8oxCqzvXGmdaKMaGXng+irczqMCsx5BVzlcOfmJA9C5zqOK qxnz49uNpil0D/d8q2uHM5YuzJnTyI4ic91i7s0CyL5QSPji9Fux8ExDBDZnl/oDkPS9 aoFadMWOuq6urX0QAld0AhYnyXLSj2zlPvEQaawD7C7VEVObKWHDlGfKi8yXr4jv3AlI ngFyek+k78ww9MsS8NwQThGZJt/SJ7q6En/dQWAHI9lT7gU3S4MZD0lqQ1qNJV4oFELF HtDHv86T5XJiX/ncP9ss4GCipDuYbWhSgU9iGsbAVJ+MO2JRucRJonutmLRzqxjs5MtM H27w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Nk3svj1pJwXgIjjAVC+MCxRt+kavEJsVSTU3kUUMlKQ=; b=TrIzVj9WQe/jyiUkdQrxmNN/+VOck1WSISDZc6ULiQKHpFHrrOIO4fCUQ9/oY1DVL/ +8EhyZYSx0o9N8Y2dg/EfShoipLsCmaNTlbIVBTmvWseQzVA5MXNvMGsc4a23Mb57pS7 RonhiB4pJkj014MSAfTRoxjrlCH/HuND2IL7a293dPjH/q6b+/SIhNhCKOX17/apGtZO yY+8NuPGyqoSINSnXMq+L3XbOE9SkkPaea2iD/sTuP3KI46z7pLPoVieVu3y8pEHD1Kx MqPMyVNp17U9QLYqrW+eJ4KdUTDtupNyMpVb13iSthw/DPFmJTBWY2hdx8xcr9npPGus +THQ== X-Gm-Message-State: ALyK8tLa8p4DNuta/xQ2LrXgUGkc44zwrcMUQCHLj5rGxP7F41CXBzpxdAATadTkpfeo7kaxu5NfMkVk0SQZoA== X-Received: by 10.129.165.144 with SMTP id c138mr8744317ywh.271.1465828542420; Mon, 13 Jun 2016 07:35:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.29.67 with HTTP; Mon, 13 Jun 2016 07:35:42 -0700 (PDT) From: Pawan Prakash Sharma Date: Mon, 13 Jun 2016 20:05:42 +0530 Message-ID: Subject: ZFS : When resilvering is in progress, ZIL disk removal is restarting the resilvering process . To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 14:35:43 -0000 This is happening because as part of clean up the vdev namespace (spa_vdev_remove_from_namespace) after removing ZIL disk, we reopen (vdev_reopen) all the vdev, which checks if resilvering is needed for a leaf vdev, if it is needed, it restarts the resilvering. It doesn't check if resilvering is already going on or not. So if resilvering is already in-progress, it will start it from the beginning. My question is, why we are not checking for dsl_scan_resilvering (we do this in spa_load_impl) in vdev_open? What will be the side effects if we put this check while opening the vdev? Let me know if I am missing anything. vdev_open() :- /* * If a leaf vdev has a DTL, and seems healthy, then kick off a * resilver. But don't do this if we are doing a reopen for a scrub, * since this would just restart the scrub we are already doing. */ if (vd->vdev_ops->vdev_op_leaf && !spa->spa_scrub_reopen && vdev_resilver_needed(vd, NULL, NULL)) spa_async_request(spa, SPA_ASYNC_RESILVER); Regards, Pawan.