Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 86C8D200CED for ; Fri, 4 Aug 2017 00:38:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8388916CB60; Thu, 3 Aug 2017 22:38:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C9DF816CB5E for ; Fri, 4 Aug 2017 00:38:04 +0200 (CEST) Received: (qmail 9078 invoked by uid 500); 3 Aug 2017 22:38:03 -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 9067 invoked by uid 99); 3 Aug 2017 22:38:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2017 22:38:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7A0D6C00C4 for ; Thu, 3 Aug 2017 22:38:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XC-e6Jz5x5aS for ; Thu, 3 Aug 2017 22:38: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 664A15FBC6 for ; Thu, 3 Aug 2017 22:38: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 9A308E0999 for ; Thu, 3 Aug 2017 22:38: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 44C892464D for ; Thu, 3 Aug 2017 22:38:00 +0000 (UTC) Date: Thu, 3 Aug 2017 22:38:00 +0000 (UTC) From: "Jaydeepkumar Chovatia (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13740) Orphan hint file gets created while node is being removed from cluster MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 03 Aug 2017 22:38:05 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13740?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jaydeepkumar Chovatia updated CASSANDRA-13740: ---------------------------------------------- Attachment: 13740-3.0.15.txt Please find patch with this fix attached. > Orphan hint file gets created while node is being removed from cluster > ---------------------------------------------------------------------- > > Key: CASSANDRA-13740 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1374= 0 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Jaydeepkumar Chovatia > Fix For: 3.0.15 > > Attachments: 13740-3.0.15.txt, gossip_hang_test.py > > > I have found this new issue during my test, whenever node is being remove= d then hint file for that node gets written and stays inside the hint direc= tory forever. I debugged the code and found that it is due to the race cond= ition between [HintsWriteExecutor.java::flush | https://github.com/apache/c= assandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hints/HintsWriteE= xecutor.java#L195] and [HintsWriteExecutor.java::closeWriter | https://gith= ub.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hi= nts/HintsWriteExecutor.java#L106] > .=20 > =20 > *Time t1* Node is down, as a result Hints are being written by [HintsWrit= eExecutor.java::flush | https://github.com/apache/cassandra/blob/cassandra-= 3.0/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java#L195] > *Time t2* Node is removed from cluster as a result it calls [HintsService= .java-exciseStore | https://github.com/apache/cassandra/blob/cassandra-3.0/= src/java/org/apache/cassandra/hints/HintsService.java#L327] which removes h= int files for the node being removed > *Time t3* Mutation stage keeps pumping Hints through [HintService.java::w= rite | https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/= apache/cassandra/hints/HintsService.java#L145] which again calls [HintsWrit= eExecutor.java::flush | https://github.com/apache/cassandra/blob/cassandra-= 3.0/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java#L215] and n= ew orphan file gets created > I was writing a new dtest for {CASSANDRA-13562, CASSANDRA-13308} and that= helped me reproduce this new bug. I will submit patch for this new dtest l= ater. > I also tried following to check how this orphan hint file responds: > 1. I tried {{nodetool truncatehints }} but it fails as node is no l= onger part of the ring > 2. I then tried {{nodetool truncatehints}}, that still doesn=E2=80=99t re= move hint file because it is not yet included in the [dispatchDequeue | htt= ps://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cas= sandra/hints/HintsStore.java#L53] > Reproducible steps: > Please find dTest python file {{gossip_hang_test.py}} attached which repr= oduces this bug. > Solution: > This is due to race condition as mentioned above. Since {{HintsWriteExecu= tor.java}} creates thread pool with only 1 worker, so solution becomes litt= le simple. Whenever we [HintService.java::excise | https://github.com/apach= e/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hints/HintsSer= vice.java#L303] a host, just store it in-memory, and check for already evic= ted host inside [HintsWriteExecutor.java::flush | https://github.com/apache= /cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hints/HintsWrit= eExecutor.java#L215]. If already evicted host is found then ignore hints. > Jaydeep -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org