[ https://issues.apache.org/jira/browse/PHOENIX-6528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17401185#comment-17401185 ]
ASF GitHub Bot commented on PHOENIX-6528: ----------------------------------------- gjacoby126 commented on a change in pull request #1286: URL: https://github.com/apache/phoenix/pull/1286#discussion_r690717001 ########## File path: phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java ########## @@ -846,18 +847,19 @@ public void setDataEncodingScheme(QualifierEncodingScheme sc) { // Write separator byte if variable length unless it's the last field in the schema // (but we still need to write it if it's DESC to ensure sort order is correct). byte sepByte = SchemaUtil.getSeparatorByte(rowKeyOrderOptimizable, ptr.getLength() == 0, dataRowKeySchema.getField(i)); - if (!dataRowKeySchema.getField(i).getDataType().isFixedWidth() && (((i+1) != dataRowKeySchema.getFieldCount()) || sepByte == QueryConstants.DESC_SEPARATOR_BYTE)) { + if (!dataRowKeySchema.getField(i).getDataType().isFixedWidth()){ output.writeByte(sepByte); + trailingVariableWidthColumnNum++; + } else { + trailingVariableWidthColumnNum = 0; } } int length = stream.size(); - int minLength = length - maxTrailingNulls; byte[] dataRowKey = stream.getBuffer(); // Remove trailing nulls - int index = dataRowKeySchema.getFieldCount() - 1; - while (index >= 0 && !dataRowKeySchema.getField(index).getDataType().isFixedWidth() && length > minLength && dataRowKey[length-1] == QueryConstants.SEPARATOR_BYTE) { + while (trailingVariableWidthColumnNum > 0 && dataRowKey[length-1] == QueryConstants.SEPARATOR_BYTE) { Review comment: OK, got it. Thanks @gokceni -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org > When view index pk has a variable length column, read repair doesn't work > correctly > ----------------------------------------------------------------------------------- > > Key: PHOENIX-6528 > URL: https://issues.apache.org/jira/browse/PHOENIX-6528 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.14.3 > Reporter: Gokcen Iskender > Assignee: Gokcen Iskender > Priority: Critical > > If a view index rowkey has a variable length column, read repair might work > incorrectly. We fixed PHOENIX-6266 and same fix should be applied to the case > where the index row is UNVERIFIED so that read repair happens. > This only happens for view indexes (mutitenant or not) > This is the reason > org.apache.phoenix.end2end.index.ViewIndexIT.testRowKeyComposition[ViewIndexIT_isNamespaceMapped=false] > sometimes flaps -- This message was sent by Atlassian Jira (v8.3.4#803005)