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 6CC58200BC0 for ; Tue, 15 Nov 2016 21:50:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6B901160AF2; Tue, 15 Nov 2016 20:50:04 +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 B40F4160B03 for ; Tue, 15 Nov 2016 21:50:03 +0100 (CET) Received: (qmail 47110 invoked by uid 500); 15 Nov 2016 20:50:02 -0000 Mailing-List: contact issues-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list issues@geode.incubator.apache.org Received: (qmail 47101 invoked by uid 99); 15 Nov 2016 20:50:02 -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; Tue, 15 Nov 2016 20:50:02 +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 6C961C7A56 for ; Tue, 15 Nov 2016 20:50:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id A99oI9sjRRQZ for ; Tue, 15 Nov 2016 20:50:01 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 495D95FBCD for ; Tue, 15 Nov 2016 20:50:01 +0000 (UTC) Received: (qmail 42493 invoked by uid 99); 15 Nov 2016 20:48:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2016 20:48:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C13CB2C4C82 for ; Tue, 15 Nov 2016 20:48:58 +0000 (UTC) Date: Tue, 15 Nov 2016 20:48:58 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@geode.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-2088) A get in transaction may get incorrect TransactionDataNotColocatedException when bucket is not hosted locally MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 15 Nov 2016 20:50:04 -0000 [ https://issues.apache.org/jira/browse/GEODE-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15668264#comment-15668264 ] ASF subversion and git services commented on GEODE-2088: -------------------------------------------------------- Commit 139398a1f5af656c59eeacdb2dd9283a7145d992 in incubator-geode's branch refs/heads/feature/GEODE-1930 from [~eshu] [ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=139398a ] GEODE-2088: Correctly throw TransactionDataRebalancedException when bucket is moved during rebalance. Turns out the transaction layer code has already handled when to throw TransactionDataNotColocatedException in getTransactionException method call in TXStateProxyImpl by checking whether the key is colocated with the keys already touched in the transaction. Only need to make sure that piece of code will be executed by throwing correct TransactionException. > A get in transaction may get incorrect TransactionDataNotColocatedException when bucket is not hosted locally > ------------------------------------------------------------------------------------------------------------- > > Key: GEODE-2088 > URL: https://issues.apache.org/jira/browse/GEODE-2088 > Project: Geode > Issue Type: Bug > Components: transactions > Reporter: Eric Shu > > Currently a get of a PR in transaction on a data node with TXState will first check if the bucket is hosted locally by following code. > {noformat} > public Object getLocally(int bucketId, final Object key, final Object aCallbackArgument, > boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, > EntryEventImpl clientEvent, boolean returnTombstones, boolean opScopeIsLocal) > throws PrimaryBucketException, ForceReattemptException, PRLocallyDestroyedException { > final BucketRegion bucketRegion = getInitializedBucketForId(key, Integer.valueOf(bucketId)); > {noformat} > The BucketNotFoundException is thrown if the node does not host the bucket: > {noformat} > public BucketRegion getInitializedBucketForId(Object key, Integer bucketId) > throws ForceReattemptException { > final BucketRegion bucketRegion = this.localBucket2RegionMap.get(bucketId); > if (null == bucketRegion) { > this.partitionedRegion.checkReadiness(); > if (logger.isDebugEnabled()) { > logger.debug("Got null bucket region for bucketId={}{}{} for PartitionedRegion = {}", > this.partitionedRegion.getPRId(), PartitionedRegion.BUCKET_ID_SEPARATOR, bucketId, > this.partitionedRegion); > } > ForceReattemptException fre = new BucketNotFoundException( > LocalizedStrings.PartitionedRegionDataStore_BUCKET_ID_0_NOT_FOUND_ON_VM_1 > .toLocalizedString( > new Object[] {this.partitionedRegion.bucketStringForLogs(bucketId.intValue()), > this.partitionedRegion.getMyId()})); > if (key != null) { > fre.setHash(key.hashCode()); > } > throw fre; > } > {noformat} > Currently, transaction would fail with the TransactionDataNotColocatedException if bucket is not on local data store > {noformat} > if (prce instanceof BucketNotFoundException) { > TransactionException ex = new TransactionDataNotColocatedException( > LocalizedStrings.PartitionedRegion_KEY_0_NOT_COLOCATED_WITH_TRANSACTION > .toLocalizedString(key)); > ex.initCause(prce); > throw ex; > } > {noformat} > This TransactionDataNotColocatedException is fine if the node never hosts bucket, or only previous operations within the transaction touches replicate regions earlier. However, if a bucket is moved to another node due to rebalance, and previous entry operations within the transaction only touches colocated regions, the transaction should fail with TransactionDataRebalancedException. > We do not have a good way currently to throw the correct exception. One idea is to iterate through the existing TXRegions in the TXState to see whether we should throw TransactionDataRebalancedException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)