The following workflow may cause an impalad that issued an invalidate metadata to falsely consider that the effect of that operation has taken effect, thus causing subsequent queries to fail due to unresolved references to tables or databases.
Steps to reproduce:
- Start an impala cluster connecting to an empty HMS (no databases).
- Create a database "db" in HMS outside of Impala (e.g. using Hive).
- Run INVALIDATE METADATA through Impala.
- Run "use db" statement in Impala.
The while condition in the code snippet below is cause the WaitForMinCatalogUpdate function to prematurely return even though INVALIDATE METADATA has not taken effect: