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

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

                Author: ASF GitHub Bot
            Created on: 22/Oct/20 14:21
            Start Date: 22/Oct/20 14:21
    Worklog Time Spent: 10m 
      Work Description: aasha commented on a change in pull request #1593:
URL: https://github.com/apache/hive/pull/1593#discussion_r510170995



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -522,6 +522,9 @@ private static void populateLlapDaemonVarsSet(Set<String> 
llapDaemonVarsSetLocal
     REPLCMINTERVAL("hive.repl.cm.interval","3600s",
         new TimeValidator(TimeUnit.SECONDS),
         "Inteval for cmroot cleanup thread."),
+    REPL_EVENT_DB_LISTENER_TTL("hive.repl.event.db.listener.timetolive", 10, 
new TimeValidator(TimeUnit.DAYS),

Review comment:
       this conf is needed only in metastore conf

##########
File path: 
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -161,6 +163,13 @@ private static synchronized void init(Configuration conf) 
throws MetaException {
     }
   }
 
+  @VisibleForTesting
+  public static synchronized void resetCleaner(HiveConf conf) throws Exception{
+    cleaner.stopRun();

Review comment:
       This will still keep the cleaner thread running. 

##########
File path: 
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -184,8 +193,25 @@ public void onConfigChange(ConfigChangeEvent tableEvent) 
throws MetaException {
           TimeUnit.SECONDS);
       MetastoreConf.setTimeVar(getConf(), 
MetastoreConf.ConfVars.EVENT_DB_LISTENER_TTL, time,
           TimeUnit.SECONDS);
-      cleaner.setTimeToLive(MetastoreConf.getTimeVar(getConf(),
-          MetastoreConf.ConfVars.EVENT_DB_LISTENER_TTL, TimeUnit.SECONDS));
+      boolean isReplEnabled = MetastoreConf.getBoolVar(getConf(), 
ConfVars.REPLCMENABLED);
+      if(!isReplEnabled){
+        cleaner.setTimeToLive(MetastoreConf.getTimeVar(getConf(), 
ConfVars.EVENT_DB_LISTENER_TTL,
+                TimeUnit.SECONDS));
+      }
+    } else if (key.equals(ConfVars.REPL_EVENT_DB_LISTENER_TTL.toString()) ||
+            key.equals(ConfVars.REPL_EVENT_DB_LISTENER_TTL.getHiveName())) {
+      // This weirdness of setting it in our conf and then reading back does 
two things.
+      // One, it handles the conversion of the TimeUnit.  Two, it keeps the 
value around for
+      // later in case we need it again.
+      long time = MetastoreConf.convertTimeStr(tableEvent.getNewValue(), 
TimeUnit.SECONDS,
+              TimeUnit.SECONDS);
+      MetastoreConf.setTimeVar(getConf(), 
MetastoreConf.ConfVars.REPL_EVENT_DB_LISTENER_TTL, time,

Review comment:
       why are you setting this twice. In line 212 also




----------------------------------------------------------------
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: 503741)
    Time Spent: 20m  (was: 10m)

> notification cleanup interval value changes depending upon replication 
> enabled or not.
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-24173
>                 URL: https://issues.apache.org/jira/browse/HIVE-24173
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Arko Sharma
>            Assignee: Arko Sharma
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently we use hive.metastore.event.db.listener.timetolive to determine how 
> long the events are stored in rdbms backing hms. We should have another 
> configuration for the same purpose in context of replication so that we have 
> longer time configured for that otherwise we can default to a 1 day.
> hive.repl.cm.enabled can be used to identify if replication is enabled or 
> not. if enabled use the new configuration property to determine ttl for 
> events in rdbms else use hive.metastore.event.db.listener.timetolive for ttl.



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

Reply via email to