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 76E64200CED for ; Fri, 4 Aug 2017 00:05:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5DDDB16CA61; Thu, 3 Aug 2017 22:05: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 A547016CA5F for ; Fri, 4 Aug 2017 00:05:04 +0200 (CEST) Received: (qmail 27509 invoked by uid 500); 3 Aug 2017 22:05: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 27498 invoked by uid 99); 3 Aug 2017 22:05:03 -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; Thu, 03 Aug 2017 22:05:03 +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 416891A08B0 for ; Thu, 3 Aug 2017 22:05:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id BJUmIsu_LpYV for ; Thu, 3 Aug 2017 22:05:01 +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 277655FCE2 for ; Thu, 3 Aug 2017 22:05: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 5F370E0635 for ; Thu, 3 Aug 2017 22:05: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 0F44221D63 for ; Thu, 3 Aug 2017 22:05:00 +0000 (UTC) Date: Thu, 3 Aug 2017 22:05:00 +0000 (UTC) From: "Jaydeepkumar Chovatia (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (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:05:05 -0000 Jaydeepkumar Chovatia created CASSANDRA-13740: ------------------------------------------------- Summary: Orphan hint file gets created while node is being rem= oved from cluster Key: CASSANDRA-13740 URL: https://issues.apache.org/jira/browse/CASSANDRA-13740 Project: Cassandra Issue Type: Bug Components: Core Reporter: Jaydeepkumar Chovatia Fix For: 3.0.15 Attachments: gossip_hang_test.py I have found this new issue during my test, whenever node is being removed = then hint file for that node gets written and stays inside the hint directo= ry forever. I debugged the code and found that it is due to the race condit= ion between [HintsWriteExecutor.java::flush | https://github.com/apache/cas= sandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hints/HintsWriteExe= cutor.java#L195] and [HintsWriteExecutor.java::closeWriter | https://github= .com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hint= s/HintsWriteExecutor.java#L106] .=20 =20 *Time t1* Node is down, as a result Hints are being written by [HintsWriteE= xecutor.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.j= ava-exciseStore | https://github.com/apache/cassandra/blob/cassandra-3.0/sr= c/java/org/apache/cassandra/hints/HintsService.java#L327] which removes hin= t files for the node being removed *Time t3* Mutation stage keeps pumping Hints through [HintService.java::wri= te | https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/ap= ache/cassandra/hints/HintsService.java#L145] which again calls [HintsWriteE= xecutor.java::flush | https://github.com/apache/cassandra/blob/cassandra-3.= 0/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java#L215] and new= orphan file gets created I was writing a new dtest for {CASSANDRA-13562, CASSANDRA-13308} and that h= elped me reproduce this new bug. I will submit patch for this new dtest lat= er. I also tried following to check how this orphan hint file responds: 1. I tried {{nodetool truncatehints }} but it fails as node is no lon= ger part of the ring 2. I then tried {{nodetool truncatehints}}, that still doesn=E2=80=99t remo= ve hint file because it is not yet included in the [dispatchDequeue | https= ://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassa= ndra/hints/HintsStore.java#L53] Reproducible steps: Please find dTest python file {{gossip_hang_test.py}} attached which reprod= uces this bug. Solution: This is due to race condition as mentioned above. Since {{HintsWriteExecuto= r.java}} creates thread pool with only 1 worker, so solution becomes little= simple. Whenever we [HintService.java::excise | https://github.com/apache/= cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hints/HintsServi= ce.java#L303] a host, just store it in-memory, and check for already evicte= d host inside [HintsWriteExecutor.java::flush | https://github.com/apache/c= assandra/blob/cassandra-3.0/src/java/org/apache/cassandra/hints/HintsWriteE= xecutor.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