[ https://issues.apache.org/jira/browse/HIVE-25796?focusedWorklogId=697368&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-697368 ]
ASF GitHub Bot logged work on HIVE-25796: ----------------------------------------- Author: ASF GitHub Bot Created on: 16/Dec/21 17:03 Start Date: 16/Dec/21 17:03 Worklog Time Spent: 10m Work Description: vihangk1 commented on a change in pull request #2864: URL: https://github.com/apache/hive/pull/2864#discussion_r770743816 ########## File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java ########## @@ -4201,6 +4202,20 @@ public NotificationEventResponse getNextNotification(long lastEventId, int maxEv NotificationFilter filter) throws TException { NotificationEventRequest rqst = new NotificationEventRequest(lastEventId); rqst.setMaxEvents(maxEvents); + return getNextNotificationsInternal(rqst, false, filter); + } + + @Override + public NotificationEventResponse getNextNotification(NotificationEventRequest request, Review comment: Actually adding this to the request object will not help since even if the server does the filtering (or throwing the exception) the client API as it is implemented currently will continue to throw the exception. We cannot change the exiting client side API since I believe there are applications (e.g hive replication) which rely on this behavior currently. Hence either ways I think the change will involve client side changes. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 697368) Time Spent: 50m (was: 40m) > Allow metastore clients to fetch remaining events if some of the events are > cleaned up > -------------------------------------------------------------------------------------- > > Key: HIVE-25796 > URL: https://issues.apache.org/jira/browse/HIVE-25796 > Project: Hive > Issue Type: Improvement > Reporter: Vihang Karajgaonkar > Assignee: Vihang Karajgaonkar > Priority: Minor > Labels: pull-request-available > Time Spent: 50m > Remaining Estimate: 0h > > This is the code snippet from HiveMetastoreClient.java's getNextNotification > method > {noformat} > for (NotificationEvent e : rsp.getEvents()) { > LOG.debug("Got event with id : {}", e.getEventId()); > if (e.getEventId() != nextEventId) { > if (e.getEventId() == prevEventId) { > LOG.error("NOTIFICATION_LOG table has multiple events with the > same event Id {}. " + > "Something went wrong when inserting notification events. > Bootstrap the system " + > "again to get back teh consistent replicated state.", > prevEventId); > throw new > IllegalStateException(REPL_EVENTS_WITH_DUPLICATE_ID_IN_METASTORE); > } else { > LOG.error("Requested events are found missing in NOTIFICATION_LOG > table. Expected: {}, Actual: {}. " > + "Probably, cleaner would've cleaned it up. " > + "Try setting higher value for > hive.metastore.event.db.listener.timetolive. " > + "Also, bootstrap the system again to get back > the consistent replicated state.", > nextEventId, e.getEventId()); > throw new IllegalStateException(REPL_EVENTS_MISSING_IN_METASTORE); > } > } > {noformat} > Consider the case when a client which caches a event id and tries to fetch > the next events since the eventid after long time. In this case, it is > possible that Metastore has cleaned up the events because they were more than > 24 hrs old. In such a case, this API throws an exception. It is possible that > client does not care if the events are not in sequence and hence this > exception should be thrown optionally depending on what the client wants. -- This message was sent by Atlassian Jira (v8.20.1#820001)