Github user karanmehta93 commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/277#discussion_r146695278
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java 
---
    @@ -95,6 +97,7 @@
         // Key is the SYSTEM.CATALOG timestamp for the version and value is 
the version string.
         private static final NavigableMap<Long, String> TIMESTAMP_VERSION_MAP 
= new TreeMap<>();
         static {
    +        TIMESTAMP_VERSION_MAP.put(MIN_SYSTEM_TABLE_MIGRATION_TIMESTAMP, 
MIGRATION_IN_PROGRESS);
    --- End diff --
    
    Nope, this one is not only for test. 
    
    When you acquire a lock on SYSMUTEX, the method requires you to pass in a 
server side timestamp of SYSCAT table (Since it was meant for that earlier) and 
it checks if the current timestamp is less than the MIN_SYSTEM_TABLE_TIMESTAMP 
before upgrading it.
    I can't use MIN_SYSTEM_TABLE_TIMESTAMP because then the code for 
`acquireUpgradeMutex()` wont allow me to acquire the mutex lock.
    I use the same `UpgradeInProgressException` to prevent multiple clients 
migrating the system tables together. I use this value in 
`UpgradeInProgressException` to change the error message displayed to the user. 


---

Reply via email to