Affects Version/s: None
Fix Version/s: None
Plain SELECT queries don't take ACID locks. They use the latest snapshot of the table that is loaded by CatalogD.
However, DML statements lock all the tables it references, not just the target table.
acquires locks for both target_table and source_table. However, after acquiring the locks Impala doesn't reload the tables.
Therefore the following situation is possible:
while the following statement also tries to take a SHARED_LOCK for foo:
It means the INSERT INTO statement might wait for the completion of the INSERT OVERWRITE statement, but since it doesn't reload foo it will still use the old snapshot of foo, hence there was no benefit of waiting for the lock.
- Re-load tables after the lock is acquired
- Only take lock for the target table. This would be better than the current behavior, also it would be consistent with plain SELECT queries.
I think reloading should be favored as Impala should run every statement (that involves ACID tables) in a transaction and take proper locks, see IMPALA-8788.