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 15890200BF3 for ; Thu, 22 Dec 2016 00:40:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 140F8160B3A; Wed, 21 Dec 2016 23:40:00 +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 6108E160B26 for ; Thu, 22 Dec 2016 00:39:59 +0100 (CET) Received: (qmail 13642 invoked by uid 500); 21 Dec 2016 23:39:58 -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 13630 invoked by uid 99); 21 Dec 2016 23:39:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2016 23:39:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 5BB772C0059 for ; Wed, 21 Dec 2016 23:39:58 +0000 (UTC) Date: Wed, 21 Dec 2016 23:39:58 +0000 (UTC) From: "Paulo Motta (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-13069) Local batchlog for MV may not be correctly written on node movements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 21 Dec 2016 23:40:00 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paulo Motta updated CASSANDRA-13069: ------------------------------------ Status: Patch Available (was: Open) Good catch! In the patch below I fixed this by writing a single batchlog for all non-local mutations (remote as well as non-paired). If the batchlog contains non-paired mutations, it will not receive acks and thus it will not be cleared. I also removed the {{pendingEndpoints.isEmpty()}} condition to skip the batchlog for local mutations, since this was a pre-CASSANDRA-10674 leftover when [ViewUtils.getViewNaturalEndpoint|https://github.com/apache/cassandra/blob/cassandra-3.0.0-rc1/src/java/org/apache/cassandra/db/view/ViewUtils.java#L100] returned the local address to force non-paired replicas to be written to the batchlog. While fixing this I noticed that we don't decrement the {{BatchlogCleanup}} counter on local mutations, so if there are both local and remote paired mutations the batchlog is never cleared. This was reproduced on [this dtest|https://github.com/riptano/cassandra-dtest/compare/master...pauloricardomg:13069]. This might explain why [~brstgt] experienced multi-GB batchlogs when bootstrapping nodes with multiple MVs on CASSANDRA-12905. Patch and tests available below: ||3.0||3.11||trunk||dtest|| |[branch|https://github.com/apache/cassandra/compare/cassandra-3.0...pauloricardomg:3.0-13069]|[branch|https://github.com/apache/cassandra/compare/cassandra-3.11...pauloricardomg:3.11-13069]|[branch|https://github.com/apache/cassandra/compare/trunk...pauloricardomg:trunk-13069]|[branch|https://github.com/riptano/cassandra-dtest/compare/master...pauloricardomg:13069]| |[testall|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-3.0-13069-testall/lastCompletedBuild/testReport/]|[testall|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-3.11-13069-testall/lastCompletedBuild/testReport/]|[testall|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-trunk-13069-testall/lastCompletedBuild/testReport/]| |[dtest|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-3.0-13069-dtest/lastCompletedBuild/testReport/]|[dtest|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-3.11-13069-dtest/lastCompletedBuild/testReport/]|[dtest|http://cassci.datastax.com/view/Dev/view/paulomotta/job/pauloricardomg-trunk-13069-dtest/lastCompletedBuild/testReport/]| > Local batchlog for MV may not be correctly written on node movements > -------------------------------------------------------------------- > > Key: CASSANDRA-13069 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13069 > Project: Cassandra > Issue Type: Bug > Reporter: Sylvain Lebresne > Assignee: Paulo Motta > > Unless I'm really reading this wrong, I think the code [here|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/StorageProxy.java#L829-L843], which comes from CASSANDRA-10674, isn't working properly. > More precisely, I believe we can have both paired and unpaired mutations, so that both {{if}} can be taken, but if that's the case, the 2nd write to the batchlog will basically overwrite (remove) the batchlog write of the 1st {{if}} and I don't think that's the intention. In practice, this means "paired" mutation won't be in the batchlog, which mean they won't be replayed at all if they fail. -- This message was sent by Atlassian JIRA (v6.3.4#6332)