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

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

                Author: ASF GitHub Bot
            Created on: 17/Nov/21 06:08
            Start Date: 17/Nov/21 06:08
    Worklog Time Spent: 10m 
      Work Description: pkumarsinha commented on a change in pull request #2789:
URL: https://github.com/apache/hive/pull/2789#discussion_r750902924



##########
File path: 
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -1417,10 +1426,27 @@ private void process(NotificationEvent event, 
ListenerEvent listenerEvent) throw
       setTimeToLive(MetastoreConf.getTimeVar(conf, ttlConf, TimeUnit.SECONDS));
       setCleanupInterval(
           MetastoreConf.getTimeVar(conf, 
ConfVars.EVENT_DB_LISTENER_CLEAN_INTERVAL, TimeUnit.MILLISECONDS));
+      setWaitInterval(MetastoreConf
+          .getTimeVar(conf, EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL, 
TimeUnit.MILLISECONDS));
     }
 
     @Override
     public void run() {
+      LOG.info("Wait interval is {}", waitInterval);
+      if (waitInterval > 0) {
+        try {
+          LOG.info("Cleaner Thread Restarted and {} or {} is configured. So 
cleaner thread will startup post waiting "
+                  + "{} ms", EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL,
+              EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL.getHiveName(), 
waitInterval);
+          Thread.sleep(waitInterval);
+        } catch (InterruptedException e) {
+          LOG.error("Failed during the initial wait before start.", e);
+          Thread.currentThread().interrupt();

Review comment:
       Also, Interruption to this thread can cause event entry accumulation in 
the back-end DB. Rather, should we make this thread immune to interruption? Is 
this only expected to happen during the test run?

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
##########
@@ -752,6 +752,9 @@ public static ConfVars getMetaConf(String name) {
     
EVENT_DB_LISTENER_CLEAN_INTERVAL("metastore.event.db.listener.clean.interval",
             "hive.metastore.event.db.listener.clean.interval", 7200, 
TimeUnit.SECONDS,
             "sleep interval between each run for cleanup of events from the 
database listener queue"),
+    
EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL("metastore.event.db.listener.clean.startup.wait.interval",
+        "hive.metastore.event.db.listener.clean.startup.wait.interval", 1, 
TimeUnit.DAYS,
+        "wait interval post start of Cleaner thread after which the cleaner 
thread starts to work"),

Review comment:
       a) Capitalize "wait".
   b) Is there a difference between Cleaner thread start time vs HMS process 
uptime(not considering time taken to launch a thread which idea would be very 
minimal)? If not, then referring to process start time would be better to 
convey the same.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 682391)
    Time Spent: 20m  (was: 10m)

> Prevent deletion of Notification Events post restarts
> -----------------------------------------------------
>
>                 Key: HIVE-25700
>                 URL: https://issues.apache.org/jira/browse/HIVE-25700
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In case of DR scenarios, when Hive service goes down, Prevent deletion of 
> entries in the Notification Log immediately, Give time for ADMINs to 
> reconfigure properties to handle further Replication process.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to