From commits-return-208958-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Fri Apr 13 18:34:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 15D4F180718 for ; Fri, 13 Apr 2018 18:34:04 +0200 (CEST) Received: (qmail 29649 invoked by uid 500); 13 Apr 2018 16:34:04 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 29599 invoked by uid 99); 13 Apr 2018 16:34:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2018 16:34:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 87CF91A1B52 for ; Fri, 13 Apr 2018 16:34:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id XMyTrLUIibYh for ; Fri, 13 Apr 2018 16:34:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E2C7D5FAEB for ; Fri, 13 Apr 2018 16:34:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EB242E0C4A for ; Fri, 13 Apr 2018 16:34:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5D5B5241CF for ; Fri, 13 Apr 2018 16:34:00 +0000 (UTC) Date: Fri, 13 Apr 2018 16:34:00 +0000 (UTC) From: "Ariel Weisberg (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-14383) If fsync fails it's always an issue and continuing execution is suspect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-14383?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D16437541#comment-16437541 ]=20 Ariel Weisberg commented on CASSANDRA-14383: -------------------------------------------- There is one usage of trySync on a directory in SequentialWriter which we u= se for data we care about. There is also usage in=C2=A0LogReplica. There ar= e sync calls that go to NativeLibrary instead of SyncUtil and we shouldn't = be doing that. Generally things are a little confused with some duplication that could be = cleaned up. There is a helper for opening the directory and getting an FD o= n it so other code shouldn't be doing it directly. The bigger question of what we should do when fsync generates an error I am= still undecided on. > If fsync fails it's always an issue and continuing execution is suspect > ----------------------------------------------------------------------- > > Key: CASSANDRA-14383 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1438= 3 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Ariel Weisberg > Assignee: Ariel Weisberg > Priority: Major > Fix For: 2.1.x, 3.0.x, 3.11.x, 4.0.x > > > We can't catch fsync errors and continue so we shouldn't have code that d= oes that in C*. There was a Postgres bug where fsync returned an error and = the FS lost data, but subsequent fsyncs succeeded. > The [LastErrorException code in NativeLibrary.trySync|https://github.com/= apache/cassandra/commit/be313935e54be450d9aaabda7965a2f266e922c9#diff-42586= 21cdf765f0fea6770db5d40038fR307] looks a little janky. What's up with that?= When would trySync be something we would merely try? If try is good enough= why do it at all considering try is the default behavior of a series of un= synced filesystem operations. > -Also when we fsync in FD it's not just fsyncing that file the FS is pote= ntially fsyncing other data and the error code we get could be related to t= hat other data so we can't safely ignore it. The filesystem could be intern= ally inconsistent as well. This happens because the FS journaling may force= the FS to flush other data as well to preserve the ordering requirements o= f journaled metadata.- I'm actually not 100% sure when/if this is the case. > If we ignore fsync errors it needs to be for whitelisted reasons such as = a bad FD. > I know we have FSErrorHandler and it makes sense for reads, but I'm not s= old on it being the right answer for writes. We don't retry flushing a memt= able or writing to the commit log to my knowledge. We could go read only an= d I need to check if that is what we do in practice. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org