Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E38F517245 for ; Fri, 6 Feb 2015 13:20:34 +0000 (UTC) Received: (qmail 13630 invoked by uid 500); 6 Feb 2015 13:20:34 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 13554 invoked by uid 500); 6 Feb 2015 13:20:34 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 13541 invoked by uid 99); 6 Feb 2015 13:20:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2015 13:20:34 +0000 Date: Fri, 6 Feb 2015 13:20:34 +0000 (UTC) From: "Torsten Mielke (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQ-5568) Deleting lock file on broker shut down can take a master broker down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-5568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14309106#comment-14309106 ] Torsten Mielke commented on AMQ-5568: ------------------------------------- It seems the broker simply deletes the lock file on the persistence adapter without any further checks. Perhaps a fix is to delete the lock file only if the broker still holds the lock and otherwise just shut down without deleting the file. > Deleting lock file on broker shut down can take a master broker down > -------------------------------------------------------------------- > > Key: AMQ-5568 > URL: https://issues.apache.org/jira/browse/AMQ-5568 > Project: ActiveMQ > Issue Type: Bug > Components: Broker, Message Store > Affects Versions: 5.11.0 > Reporter: Torsten Mielke > Labels: persistence > > This problem may only occur on a shared file system master/slave setup. > I can reproduce reliably on a NFSv4 mount using a persistence adapter configuration like > {code} > > > > > > {code} > However the problem is also reproducible using kahaDB. > Two broker instances competing for the lock on the shared storage (e.g. leveldb or kahadb). Lets say brokerA becomes master, broker B slave. > If brokerA looses access to the NFS share, it will shut down. As part of shutting down, it tries delete the lock file of the persistence adapter. Now since the NFS share is gone, all file i/o calls hang for a good while before returning errors. As such the broker shut down gets delayed. > In the meantime the slave broker B (not affected by the NFS problem) grabs the lock and becomes master. > If the NFS mount is restored while broker A (the previous master) still hangs on the file i/o operations (as part of its shutdown routine), the attempt to delete the persistence adapter lock file will finally succeed and broker A shuts down. > Deleting the lock file however also affects the new master broker B who periodically runs a keepAlive() check on the lock. That check verifies the file still exists and the FileLock is still valid. As the lock file got deleted, keepAlive() fails on broker B and that broker shuts down as well. > The overall result is that both broker instances have shut down despite an initially successful failover. > Using restartAllowed=true is not an option either as this can cause other problems in an NFS based master/slave setup. -- This message was sent by Atlassian JIRA (v6.3.4#6332)