Repository: phoenix
Updated Branches:
  refs/heads/4.x-cdh5.15 6b877d21b -> 7f13f87c5


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/8c7866f4
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8c7866f4
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8c7866f4

Branch: refs/heads/4.x-cdh5.15
Commit: 8c7866f4258d99f30d392e82c3f18218c909c68a
Parents: 6b877d2
Author: Vincent Poon <vincentp...@apache.org>
Authored: Tue Oct 16 03:11:40 2018 +0100
Committer: pboado <pedro.bo...@gmail.com>
Committed: Sun Nov 25 22:08:30 2018 +0000

----------------------------------------------------------------------
 .../org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8c7866f4/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

Reply via email to