Vihang Karajgaonkar has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/15260


Change subject: IMPALA-9357: Fix race condition in alter_database event
......................................................................

IMPALA-9357: Fix race condition in alter_database event

The race condition is exposed intermittently, on certain builds which
causes test_event_processing::test_self_events test to fail. This
happens because we are checking for self-event identifiers in the Db
object without taking the version lock. When a DDL like 'comment on
database is 'test'' is executed, it is possible that the event
processor thread is triggered as soon as the ALTER_DATABASE event is
generated. This may cause event processor fail the self-event detection
since the self-event identifiers are not yet added to the Db object.

The fix is to take the version lock before looking for such ids in the
Db. This does not happen for table or partition events, since in that
case, we take the table lock.

Testing:
1. Ran existing tests for events processor.
2. [WIP] The test is hard to reproduce locally. I will try to run
the test in a loop for a long duration to make sure it doesn't fail.

Change-Id: I472fd8a55740769ee5cdb84e48422a4ab39a8d1e
---
M fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java
1 file changed, 28 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/60/15260/1
--
To view, visit http://gerrit.cloudera.org:8080/15260
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I472fd8a55740769ee5cdb84e48422a4ab39a8d1e
Gerrit-Change-Number: 15260
Gerrit-PatchSet: 1
Gerrit-Owner: Vihang Karajgaonkar <[email protected]>

Reply via email to