IMPALA-10746: Drop table/db from catalog cache when drop table/db HMS

apis are accessed from catalog's metastore server.

This patch fixes a scenario where if table/db already exists in
cache and a user drops it via catalog metastore server endpoint
(i.e drop_table HMS api). When recreating the same via Impala
Shell, user gets an error that table/db already exists. The patch
fixes it by dropping table/db from HMS endpoints so that new
table/db succeeds

Testing:
 Added new unit tests which cover drop_database and
drop_table HMS API

Change-Id: Ic2e2ad2630e2028b8ad26a6272ee766b27e0935c
Reviewed-on: http://gerrit.cloudera.org:8080/17576
Reviewed-by: <kishen@cloudera.com>
Reviewed-by: Vihang Karajgaonkar <vihang@cloudera.com>
Tested-by: Vihang Karajgaonkar <vihang@cloudera.com>
This commit is contained in:
Sourabh Goyal
2021-04-08 15:01:39 -07:00
committed by Vihang Karajgaonkar
parent 494588b601
commit fcbb15a5ea
6 changed files with 326 additions and 48 deletions

View File

@@ -101,6 +101,13 @@ class EventProcessorUtils(object):
assert 'last-synced-event-id' in metrics.keys()
return int(metrics['last-synced-event-id'])
@staticmethod
def get_num_skipped_events():
"""Returns number of skipped events from metrics"""
metrics = EventProcessorUtils.get_event_processor_metrics()
assert "events-skipped" in metrics.keys()
return int(metrics['events-skipped'])
@staticmethod
def get_event_processor_status():
"""