From commits-return-23678-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Mon Oct 22 21:04:32 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 452C818064A for ; Mon, 22 Oct 2018 21:04:32 +0200 (CEST) Received: (qmail 14181 invoked by uid 500); 22 Oct 2018 19:04:31 -0000 Mailing-List: contact commits-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list commits@phoenix.apache.org Received: (qmail 14172 invoked by uid 99); 22 Oct 2018 19:04:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2018 19:04:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4B52FDFF41; Mon, 22 Oct 2018 19:04:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vincentpoon@apache.org To: commits@phoenix.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: phoenix git commit: PHOENIX-4960 Write to table with global index failed if meta of index changed (split, move, etc) Date: Mon, 22 Oct 2018 19:04:31 +0000 (UTC) Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.2 a052d5d7e -> ae71fa870 PHOENIX-4960 Write to table with global index failed if meta of index changed (split, move, etc) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ae71fa87 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ae71fa87 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ae71fa87 Branch: refs/heads/4.x-HBase-1.2 Commit: ae71fa87034bb216f9478c942f2ae7a72e595e38 Parents: a052d5d Author: Vincent Poon Authored: Mon Oct 15 19:11:40 2018 -0700 Committer: Vincent Poon Committed: Mon Oct 22 12:04:26 2018 -0700 ---------------------------------------------------------------------- .../org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ae71fa87/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java index 21370f3..aa78b1b 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java @@ -3987,6 +3987,10 @@ public class MetaDataEndpointImpl extends MetaDataProtocol implements Coprocesso newKVs.remove(disableTimeStampKVIndex); newKVs.set(indexStateKVIndex, KeyValueUtil.newKeyValue(key, TABLE_FAMILY_BYTES, INDEX_STATE_BYTES, timeStamp, Bytes.toBytes(newState.getSerializedValue()))); + } else if (disableTimeStampKVIndex == -1) { // clear disableTimestamp if client didn't pass it in + newKVs.add(KeyValueUtil.newKeyValue(key, TABLE_FAMILY_BYTES, + PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP_BYTES, timeStamp, PLong.INSTANCE.toBytes(0))); + disableTimeStampKVIndex = newKVs.size() - 1; } } else if (newState == PIndexState.DISABLE) { //reset the counter for pending disable when transitioning from PENDING_DISABLE to DISABLE