[email protected] has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24389
Change subject: IMPALA-15051: Fix IllegalStateException in TableEventExecutor.clear on global invalidate ...................................................................... IMPALA-15051: Fix IllegalStateException in TableEventExecutor.clear on global invalidate This patch fixes java.lang.IllegalStateException in TableEventExecutor.clear() when an INVALIDATE METADATA command is executed. The issue occurs when a table is renamed using a case-variant database (e.g., 'Mydb', 'mYdb', or 'myDB' are case-variants of 'mydb'). When a table is assigned/mapped to a TableEventExecutor and the table is renamed using a database name case-variant, instead of using the already assigned TableEventExecutor, a new TableEventExecutor is assigned/mapped for the table. Hence, the tableProcessors_ map on DbProcessor is updated with a new TableProcessor and the existing TableProcessor remains dangling at the other TableEventExecutor. On global invalidate, EventExecutorService.clear() clears DbEventExecutors, that internally removes all the DbProcessors and the TableProcessors. As a sanity check, DbEventExecutor's clear invokes clear on its TableEventExecutors towards the end. TableEventExecutors do not have anything to clear at that point other than just asserting and logging the state. But in this particular case, there exists a TableEventExecutor with a dangling TableProcessor, which triggered a state check failure on TableEventExecutor for tableProcessors_.isEmpty(). Normalized database and table names to lowercase when constructing fully qualified table name for TableEventExecutor assignment/lookup, and in the wait for event sync flow to consider events as synced correctly. Testing: - Added a test to verify the sequence of case-sensitive rename followed by INVALIDATE METADATA completes successfully and keeps the event processor ACTIVE. - Added a test verify event sync waited correctly with case-sensitive name used in the query. Change-Id: I9dd210a61e4fbd593a3d30b63b1d879cc0ce2d24 --- M fe/src/main/java/org/apache/impala/catalog/events/DbEventExecutor.java M fe/src/main/java/org/apache/impala/catalog/events/EventExecutorService.java M fe/src/main/java/org/apache/impala/catalog/events/MetastoreEventsProcessor.java M tests/custom_cluster/test_events_custom_configs.py 4 files changed, 52 insertions(+), 13 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/89/24389/1 -- To view, visit http://gerrit.cloudera.org:8080/24389 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9dd210a61e4fbd593a3d30b63b1d879cc0ce2d24 Gerrit-Change-Number: 24389 Gerrit-PatchSet: 1 Gerrit-Owner: Anonymous Coward <[email protected]>
