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 7D2A6200B44 for ; Thu, 14 Jul 2016 16:38:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7B320160A63; Thu, 14 Jul 2016 14:38:22 +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 C4DE4160A88 for ; Thu, 14 Jul 2016 16:38:21 +0200 (CEST) Received: (qmail 99110 invoked by uid 500); 14 Jul 2016 14:38:21 -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 99020 invoked by uid 99); 14 Jul 2016 14:38:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jul 2016 14:38:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AD34F2C02B4 for ; Thu, 14 Jul 2016 14:38:20 +0000 (UTC) Date: Thu, 14 Jul 2016 14:38:20 +0000 (UTC) From: "Joshua McKenzie (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-12198) Deadlock in CDC during segment flush MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 14 Jul 2016 14:38:22 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15377031#comment-15377031 ] Joshua McKenzie commented on CASSANDRA-12198: --------------------------------------------- CI looks good - failures aren't related to this change. Committed to 3.8 branch, also to 3.9 then merged to trunk. > Deadlock in CDC during segment flush > ------------------------------------ > > Key: CASSANDRA-12198 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12198 > Project: Cassandra > Issue Type: Bug > Reporter: Joshua McKenzie > Assignee: Joshua McKenzie > Priority: Blocker > Fix For: 3.8 > > > In the patch for CASSANDRA-8844, we added a {{synchronized(this)}} block inside CommitLogSegment.setCDCState. This introduces the possibility of deadlock in the following scenario: > # A {{CommitLogSegment.sync()}} call is made (synchronized method) > # A {{CommitLogSegment.allocate}} call from a cdc-enabled write is in flight and acquires a reference to the Group on appendOrder (the OpOrder in the Segment) > # {{CommmitLogSegment.sync}} hits {{waitForModifications}} which calls {{appendOrder.awaitNewBarrier}} > # The in-flight write, if changing the state of the segment from CDCState.PERMITTED to CDCState.CONTAINS, enters {{setCDCState}} and blocks on synchronized(this) > And neither of them ever come back. This came up while doing some further work on CASSANDRA-12148. -- This message was sent by Atlassian JIRA (v6.3.4#6332)