twdsilva commented on a change in pull request #541: PHOENIX-4893 Move parent
column combining logic of view and view inde…
URL: https://github.com/apache/phoenix/pull/541#discussion_r303635558
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
##########
@@ -3045,14 +2611,26 @@ MetaDataMutationResult updateMutation(PTable table,
byte[][] rowKeyMetaData,
// mutateRowsWithLocks call
long currentTime =
MetaDataUtil.getClientTimeStamp(tableMetadata);
// if the update mutation caused tables to be deleted just
return the result which will contain the table to be deleted
- if (result !=null) {
+ if (result != null
+ && result.getMutationCode() !=
MutationCode.TABLE_ALREADY_EXISTS) {
return result;
} else {
- table = buildTable(key, cacheKey, region,
HConstants.LATEST_TIMESTAMP, clientVersion, false, false, null);
- return new
MetaDataMutationResult(MutationCode.TABLE_ALREADY_EXISTS, currentTime, table);
+ table = buildTable(key, cacheKey, region,
HConstants.LATEST_TIMESTAMP, clientVersion);
+ return new
MetaDataMutationResult(MutationCode.TABLE_ALREADY_EXISTS, currentTime, table,
+ tableNamesToDelete, sharedTablesToDelete);
}
} finally {
- releaseRowLocks(region,locks);
+ releaseRowLocks(region, locks);
+ // drop indexes on views that require the column being dropped
Review comment:
drop (possibly remote) child view indexes after releasing the parent table
lock. If in the meantime one of these views are resolved, we will resolve the
parent table and skip adding any indexes that can't be used.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services