Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E8F8F10AA5 for ; Fri, 8 Nov 2013 14:58:16 +0000 (UTC) Received: (qmail 7160 invoked by uid 500); 8 Nov 2013 14:58:15 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 7052 invoked by uid 500); 8 Nov 2013 14:58:09 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 7034 invoked by uid 99); 8 Nov 2013 14:58:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 14:58:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of haosdent@gmail.com designates 209.85.160.43 as permitted sender) Received: from [209.85.160.43] (HELO mail-pb0-f43.google.com) (209.85.160.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 14:58:01 +0000 Received: by mail-pb0-f43.google.com with SMTP id md4so2234061pbc.16 for ; Fri, 08 Nov 2013 06:57:40 -0800 (PST) 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 :content-type; bh=n/ZU70bGKKN+rcpV+PYD/a84IOA+YwIYa6kUh0mHCjU=; b=cZ4XI3Jexh5d2lLJzRE6u6A2t9BYJSY2t1ZeNoqxUQOdHUgNHngu+aBmC1Ur83usC1 g8DQkCCRdI0ERPrE1QVCwGCqy0lgFVRYLlXt1y6etC9AP7IZGVWkSD3W/3zMfmhh+fVS fxZhM/n8MbYbJzwWGDtFOWokK7UMMG+R9H7bv1EwEE8LDtngVP0p8kKnkuXgLZbRq2dR P9WTvoLizH2eNNGDKTVr10HI7npgc72Y/xUaB3NDjRkMce26/68KjSRjMI7dr+9lU3Ao MicL6/xVmBRYQFfE/ZDUoOPDe/NJnY4Mi+BUU9lrLb0H56oU+xaX52Pz/zlW0iWAcYxi EMMg== MIME-Version: 1.0 X-Received: by 10.66.66.42 with SMTP id c10mr16094256pat.98.1383922660409; Fri, 08 Nov 2013 06:57:40 -0800 (PST) Received: by 10.70.40.166 with HTTP; Fri, 8 Nov 2013 06:57:40 -0800 (PST) Received: by 10.70.40.166 with HTTP; Fri, 8 Nov 2013 06:57:40 -0800 (PST) In-Reply-To: References: Date: Fri, 8 Nov 2013 22:57:40 +0800 Message-ID: Subject: Re: Calling o/s.flush() in HLog.sync()? From: Haosong Huang To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=001a113630e092082704eaab9a69 X-Virus-Checked: Checked by ClamAV on apache.org --001a113630e092082704eaab9a69 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Sorry, I misunderstood what you ask. 2013-11-6 =C9=CF=CE=E79:23=D3=DA "Himanshu Vashishtha" = =D0=B4=B5=C0=A3=BA > Okay, good to know but not sure how your response is related to what I > asked. > > > On Tue, Nov 5, 2013 at 1:08 AM, Haosong Huang wrote: > > > An os fsync() call will spent nearly 10ms because of the harddisk iops > > neckbottle. A hsync() would become two os fsync(). One for checksum fil= e > > and theother for block file. If you use SSD disk, you could try use > fsync() > > instead of flush() and mount file system without writebarrier. > > 2013-11-5 =CF=C2=CE=E71:12=D3=DA "Himanshu Vashishtha" =D0=B4=B5=C0=A3=BA > > > > > Looking at ProtobufLogWriter class, it looks like the call to flush() > in > > > the sync method is a noop. > > > > > > > > > > > > https://github.com/apache/hbase/blob/trunk/hbase-server/src/main/java/org= /apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java#L134 > > > > > > The underlying output stream is DFSOutputStream, which doesn't > implement > > > flush(). > > > > > > And, it calls sync() anyway, which ensures the data is written to DN'= s > > > (cache). > > > > > > Previously with SequenceFile$Writer, it writes data to the outputstre= am > > > (using Writables#write), and invoke sync/hflush. > > > > > > > > > https://github.com/apache/hadoop-common/blob/trunk/hadoop-common-project/= hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java#L1314 > > > > > > Is there a reason we have this call here? Please let me know if I mis= s > > any > > > context. > > > > > > Thanks, > > > Himanshu > > > > > > --001a113630e092082704eaab9a69--