From users-return-49588-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Wed Mar 7 16:43:12 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id DAB6C180656 for ; Wed, 7 Mar 2018 16:43:11 +0100 (CET) Received: (qmail 48993 invoked by uid 500); 7 Mar 2018 15:43:10 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 48977 invoked by uid 99); 7 Mar 2018 15:43:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2018 15:43:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7F61AC11A4 for ; Wed, 7 Mar 2018 15:43:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id cfa_E-qk0vsd for ; Wed, 7 Mar 2018 15:43:08 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D759F5F640 for ; Wed, 7 Mar 2018 15:43:07 +0000 (UTC) Received: by mail-lf0-f45.google.com with SMTP id g72-v6so3892964lfg.3 for ; Wed, 07 Mar 2018 07:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=EOng6ZR+3InWwRFP4iG4PKiIhAvu9uiQH27S5jX3YAs=; b=qnt2NyOv7sVdYEhdC0cGdb+PW1Wd4rLqQHMMcGIysUE0iq4BvfGgt8cEN+Z8bPL14/ IgdtJ4zJVjJbHj5H6Ojvw3H6HQ2u55k2XPuqHah9bVwi5XAHGKLG12mf1k0pX/el55PL YwnW8fLNtewxk9q4XQ89nazG0uBySGlrAXde0PmyTuOk7CXOPiCDUjwnqt1e+46UN9xm ss6tduBlIEAs1qNHflFjjh4ZgFg/SdHr/Phmhq4uMIYV57WYcdzmAQLJiPqGvwc79aCF ZJPoCjRwKdJ5CM3ua9amptLbWkoQX3AsHMp+jon9vmH82mN6c2ylXbMYcRfniEU4rsOe VlfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=EOng6ZR+3InWwRFP4iG4PKiIhAvu9uiQH27S5jX3YAs=; b=ON1qbcNBKjN4TSNlWxl7zDWhqreV1jDFlGi9pqZVDO+SLyrH+ixEbaVZNE0RP9lA9H H0QmTx5qukrLykp7uvex1Fcrmo4w6bLZ98eAgKP0XNf4WhDVvYL92RAvC6nGwqmxNYTW dWKkXCwjE536iYE5Sw6Rm+foFFxl1vzI3b4ZbfwBK5Mf4luBfGsoJYLfR1Fa17sSaTl6 vbcVFXSRwbssm0Jbhl5SiVyD9rZLT7clJGbMAbGqx9qCjWJ0ygHQvr1g0uic5uuuB/xi 6KO1Ls0wOEztgkWj6yieyROKUVkmkRslfTrn5isMisRh/59Efz2Lil7Zpyh/6z2bMlhy tTJg== X-Gm-Message-State: AElRT7Euat/Js4RxhquZQGW51x9f4NmCZcEbs+SwCNxN1AV/WPFgpTjY hvym/Lc1MUM4LxDWyES1EM+ZSNI8 X-Google-Smtp-Source: AG47ELt9jXnZ0+5XWQDb02oRIKvScQEiwC9lIfPkaoTg2zZwf4bGQf0/3tT26ajAZY+5ONPJZOdkfQ== X-Received: by 10.46.81.25 with SMTP id f25mr15352280ljb.50.1520437386901; Wed, 07 Mar 2018 07:43:06 -0800 (PST) Received: from [192.168.107.229] ([91.194.157.66]) by smtp.gmail.com with ESMTPSA id z21sm3669087ljz.83.2018.03.07.07.43.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 07:43:06 -0800 (PST) From: "mac.miklas@gmail.com" Content-Type: multipart/alternative; boundary="Apple-Mail=_22BCEC78-8AC5-4163-8D4B-2F2652728254" Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Duplicate message detection on failover Message-Id: <5F2FFC65-A069-4E2C-B513-41B78B0A447F@gmail.com> Date: Wed, 7 Mar 2018 16:43:02 +0100 To: users@activemq.apache.org X-Mailer: Apple Mail (2.3445.5.20) --Apple-Mail=_22BCEC78-8AC5-4163-8D4B-2F2652728254 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii We have ActiveMq 5.12 in following configuration: PostgreSQL for persistance two Nodes, one in Standby JDBC Master Slave with shared Database static cluster discovery Everything seams to be fine, failover works as expected, but sometimes = during failover (or restart of whole cluster) we are observing following = exception: WARN [ActiveMQ NIO Worker 6] = org.apache.activemq.transaction.LocalTransaction - Store COMMIT = FAILED:java.io.IOException: Batch entry 2 INSERT INTO ACTIVEMQ_MSGS(ID, = MSGID_PROD, MSGID_SEQ, CONTAINER, EXPIRATION, PRIORITY, MSG, XID) VALUES = (...) was aborted: Unique-Constraint activemq_msgs_pkey Detail: = key(id)=3D(7095330) alerady exists ActiveMQ propagates this exception directly to the client. I thought, that ActiveMQ would be able to recognise duplicated message, = but something goes wrong here..... The client tries to deliver message with already existing ID, should not = ActiveMQ compare this message to one already existing in storage (if = possible, depending on DB) and if both messages are the same just ignore = second message? Or maybe ActiveMQ assumes that duplicated messages are allowed to be = persisted and our DB structure is not correct (constraint on id)? CREATE TABLE activemq_msgs ( id bigint NOT NULL, container varchar(250), msgid_prod varchar(250), msgid_seq bigint, expiration bigint, msg bytea, priority bigint, xid varchar(250) ); ALTER TABLE activemq_msgs ADD CONSTRAINT activemq_msgs_pkey PRIMARY KEY (id); Should we drop activemq_msgs_pkey ?= --Apple-Mail=_22BCEC78-8AC5-4163-8D4B-2F2652728254--