phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twdsilva <...@git.apache.org>
Subject [GitHub] phoenix pull request #313: PHOENIX-4799 Write cells using checkAndMutate to ...
Date Tue, 31 Jul 2018 21:22:20 GMT
Github user twdsilva commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/313#discussion_r206687937
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java ---
    @@ -2957,6 +3010,11 @@ MutationState dropTable(String schemaName, String tableName, String
parentTableN
                     Delete linkDelete = new Delete(linkKey, clientTimeStamp);
                     tableMetaData.add(linkDelete);
                 }
    +            if (tableType == PTableType.TABLE) {
    +                // acquire a mutex on the table to prevent creating views while concurrently
    +                // dropping the base table
    +                acquiredMutex = writeCell(null, schemaName, tableName, null);
    --- End diff --
    
    Yes, I missed that. I originally had writeCell throw the ConcurrentTableMutationException,
but we need to know we need writeCell to return false if it wasn't able to do the checkAndPut
so that we can set the acquiredMutex boolean which is later used to determine if we have to
delete the cell in the finally block.


---

Mime
View raw message