From owner-freebsd-questions@FreeBSD.ORG Thu May 21 15:57:59 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 606878BE for ; Thu, 21 May 2015 15:57:59 +0000 (UTC) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (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 28D431009 for ; Thu, 21 May 2015 15:57:59 +0000 (UTC) Received: by igbhj9 with SMTP id hj9so13977592igb.1 for ; Thu, 21 May 2015 08:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dPbLG6O+Bjx64sl27lANEHqxCbDRDGKJhgFUrcdZkNc=; b=S9X6ULWXyUiQ7zcw2np2MMDDUv8+dBT1wwWhrO9TiBAu3wamJ6b/XyBVHVUmQNLeoR bdaH+iOVh8Ra8X/u3pG8zYwBwrvtPm/6znTafoTftbDUwnE55YZ3Kf4xAW6jiuH6cm8K aJWQxEZYOGPwRvToBvVC0tOCF3dMceOM+G4cu2PKR+CD4R7aEw99cfZI9l1nAaDCZZc7 edstPy2tfVoexDQ8UgvWL8kPQZEtNl/ouxdCABTCzlngS7QSDv6u6EIGZ7wEZMe4RGmF uSvkPd7CRBDAcTQV9QX7sojf7s2d7WyE0gb485a2o/G7WyyQ4QUmMKVeOKYy0shy5zCY gPaA== MIME-Version: 1.0 X-Received: by 10.43.18.194 with SMTP id qh2mr4024716icb.36.1432223878078; Thu, 21 May 2015 08:57:58 -0700 (PDT) Received: by 10.79.6.195 with HTTP; Thu, 21 May 2015 08:57:58 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 May 2015 08:57:58 -0700 Message-ID: Subject: Re: SLOG and SSDs: are "super" capacitors really needed? From: Jason Cox To: Chris Stankevitz Cc: freebsd-questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2015 15:57:59 -0000 I know I might be off here, but I think it goes like this... Write transactions are done in memory, the ZIL/SLOG is just the backup copy. So a write goes into memory, then written to the pool. The purpose of the ZIL is if a transaction does not complete to disk and the power is yanked from the machine, it can replay that transaction from the ZIL. The reason having a fast SLOG device speeds up sync writes is that the SLOG is better able to keep in sync with RAM vs. when the ZIL is on the slower spinning disk. So ZFS will not acknowledge the write till the data is in RAM and secure in the ZIL. So it is very important to have a SLOG device with a super cap for when something like the power goes out and the SSD has not completed the write from its cache to nv storage, you just lost that transaction. On Thu, May 21, 2015 at 8:38 AM, Chris Stankevitz wrote: > When sync data is written to the ZIL (or in my case to a SLOG), ZFS > waits for the write to be "completed" before continuing. Once the > write has "completed", the sync data is considered written, even if it > has not yet made it to the real storage devices. Written data has > "completed" when the ZIL device (SLOG) reports that the data has been > written. > > Question: do SSD drives report the write has "completed" only after > the data has been burned into non-volatile storage? If so, then why > do people say a good SLOG SSD has "super capacitors" that allow the > drive to continue functioning for a short time after a power failure? > It seems to me that there are two scenarios, none of which need super > capacitors: > > 1. A transaction is completely written to the SLOG, but not the > storage devices, and the power goes out. No problem, data will write > to storage when the pool is imported. > > 2. A transaction is partially written to the SLOG, but not the storage > devices, and the power goes out. No problem, the transaction will be > lost and the pool will be imported with the previously committed > data/transaction. > > I don't see a scenario where a power-outage causes a "corrupted > transaction" to be posted. > > Now if an SSD reports data "written" before it makes it to > non-volatile storage, then that is another story... but I cannot > imagine a HDD manufacturer advertising data written that is not > actually written (or guaranteed to be written even in the face of a > power outage). > > Thank you, > > Chris > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > -- Jason Cox