[ 
https://issues.apache.org/jira/browse/HIVE-24403?focusedWorklogId=519148&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-519148
 ]

ASF GitHub Bot logged work on HIVE-24403:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Dec/20 17:40
            Start Date: 02/Dec/20 17:40
    Worklog Time Spent: 10m 
      Work Description: pvargacl commented on a change in pull request #1688:
URL: https://github.com/apache/hive/pull/1688#discussion_r534357567



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -390,6 +404,42 @@ public void setConf(Configuration conf){
     }
   }
 
+  /**
+   * Check if min_history_level table is usable
+   * @return
+   * @throws MetaException
+   */
+  private boolean checkMinHistoryLevelTable(boolean configValue) throws 
MetaException {
+    if (!configValue) {
+      // don't check it if disabled
+      return false;
+    }
+    Connection dbConn = null;
+    boolean tableExists = true;
+    try {
+      dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
+      try (Statement stmt = dbConn.createStatement()) {
+        // Dummy query to see if table exists
+        try (ResultSet rs = stmt.executeQuery("SELECT 
MIN(\"MHL_MIN_OPEN_TXNID\") FROM \"MIN_HISTORY_LEVEL\"")) {

Review comment:
       fixed




----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 519148)
    Time Spent: 3h 20m  (was: 3h 10m)

> change min_history_level schema change to be compatible with previous version
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-24403
>                 URL: https://issues.apache.org/jira/browse/HIVE-24403
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>            Reporter: Peter Varga
>            Assignee: Peter Varga
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> In some configurations the HMS backend DB is used by HMS services with 
> different versions. 
>  HIVE-23107 dropped the min_history_level table from the backend DB making 
> the new schema version incompatible with the older HMS services. 
>  It is possible to modify that change to keep the compatibility
>  * Keep the min_history_level table
>  * Add the new fields for the compaction_queue the same way
>  * Create a feature flag for min_history_level and if it is on
>  * Keep the logic inserting to the table during openTxn
>  * Keep the logic removing the records at commitTxn and abortTxn
>  * Change the logic in the cleaner, to get the highwatermark the old way
>  * But still change it to not start the cleaning before that
>  * The txn_to_write_id table cleaning can work the new way in the new version 
> and the old way in the old version
>  * This feature flag can be automatically setup based on the existence of the 
> min_history level table, this way if the table will be dropped all HMS-s can 
> switch to the new functionality without restart



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to