neatHyperTxt-meesho commented on code in PR #6785:
URL: https://github.com/apache/hive/pull/6785#discussion_r4039402045


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java:
##########
@@ -145,26 +159,37 @@ void setConfForTestExceptSharedCache(Configuration conf) {
     initBlackListWhiteList(conf);
   }
 
-  private static synchronized void triggerUpdateUsingEvent(RawStore rawStore) {
+  private static void triggerUpdateUsingEvent(RawStore rawStore) {
     if (!isCachePrewarmed.get()) {
       LOG.error("cache update should be done only after prewarm");
       throw new RuntimeException("cache update should be done only after 
prewarm");
     }
-    long startTime = System.nanoTime();
-    long preEventId = lastEventId;
-    try {
-      lastEventId = updateUsingNotificationEvents(rawStore, lastEventId);
-    } catch (Exception e) {
-      LOG.error(" cache update failed for start event id " + lastEventId + " 
with error ", e);
-      throw new RuntimeException(e.getMessage());
-    } finally {
-      long endTime = System.nanoTime();
-      LOG.info("Time taken in updateUsingNotificationEvents for num events : " 
+ (lastEventId - preEventId) + " = "
-          + (endTime - startTime) / 1000000 + "ms");
+    synchronized (EVENT_UPDATE_LOCK) {

Review Comment:
   This is the isCachePrewarmed guard from HIVE-30052 (already merged), not 
something this PR changes. Events committed during prewarm are still replayed 
afterwards from the event id bookmarked before prewarm started, so the cache 
converges; the tradeoff is that the writer no longer blocks for the entire 
prewarm window instead of failing fast. Worth a separate JIRA if we want that 
path to skip quietly rather than throw out of scope here.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to