Files
impala/fe/src
stiga-huang a52721e627 IMPALA-11644: updateLatestEventId should handle cases of empty events
IMPALA-11490 adds a catalog metric for the latest event id in HMS. The
fetched events could be empty if there are no more events in the past 24
hours, since the retention duration for notification events in HMS is 24
hours by default. This case is not handled so the thread for updating
the latestEventId metric will keep throwing a NoSuchElementException
until there are new events generated.

This patch handles the case to avoid exceptions, also sets the initial
value of latestEventId to 0 which is the returned value of
getCurrentNotificationEventId() when there are no events in HMS.

Tests
- Clean up the notification events in HMS by truncating the
  NOTIFICATION_SEQUENCE and NOTIFICATION_LOG tables in the underlying
  PostgreSQL. Then launch HMS and Impala. Verified the exception
  disappears.
- Add a breakpoint in updateLatestEventId() to stop before fetching the
  events and after getting the current event id. Clean up the
  notification events in HMS. Then resume catalogd. Verified no
  exceptions are thrown.

Change-Id: I0f207fff1ff59376e30afdc3cd074c950a1c3ddb
Reviewed-on: http://gerrit.cloudera.org:8080/19112
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2022-10-10 09:51:43 +00:00
..