Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24389 )
Change subject: IMPALA-15051: Fix IllegalStateException in TableEventExecutor.clear ...................................................................... IMPALA-15051: Fix IllegalStateException in TableEventExecutor.clear 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 Reviewed-on: http://gerrit.cloudera.org:8080/24389 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- 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, 60 insertions(+), 13 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- 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: merged Gerrit-Change-Id: I9dd210a61e4fbd593a3d30b63b1d879cc0ce2d24 Gerrit-Change-Number: 24389 Gerrit-PatchSet: 4 Gerrit-Owner: Anonymous Coward <[email protected]> Gerrit-Reviewer: Anonymous Coward <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Sai Hemanth Gantasala <[email protected]>
