Csaba Ringhofer has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21663 )

Change subject: IMPALA-13126: Obtain table read lock in EP to process 
partitioned event
......................................................................


Patch Set 8: Code-Review+1

(2 comments)

lgtm, though some code could be more intuitive IMO

http://gerrit.cloudera.org:8080/#/c/21663/6/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java
File fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java:

http://gerrit.cloudera.org:8080/#/c/21663/6/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@1811
PS6, Line 1811:     @Override
              :     public void processTableEvent() throws 
MetastoreNotificationException,
              :         CatalogException {
              :       if (isRename_) {
              :         processRename();
              :         return;
              :       }
              :
              :       // Determine whether this is an event which we have 
already seen or if it is a new
              :       // event
              :       if (isSelfEvent()) {
              :         infoLog("Not processing the event as it is a 
self-event");
              :         return;
              :       }
              :       // Ignore the event i
> Since I reordered the sequence in this patchset, do we still need a separat
"Unfortunately, modifying the InFlightEvents list requires holding the table 
lock again."
Note that the table lock is only needed for partitioned events since 
https://gerrit.cloudera.org/#/c/20516/

Btw if we agree that this was a bug than it could be mentioned in the commit 
message with IMPALA-13650 as a cleaner solution?


http://gerrit.cloudera.org:8080/#/c/21663/8/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java
File fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java:

http://gerrit.cloudera.org:8080/#/c/21663/8/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java@1298
PS8, Line 1298: isTableLockRequired
This looks a bit more convoluted than necessary, especially as 
isTableLockRequired is not affected by having a partition or not.

Maybe something like
boolean canSkip = tbl.getLastRefreshEventId() >= getEventId();
if (!canSkip && partitionEventObj != null) {
  ... take lock and check isPartitionLoadedAfterEvent
}
if (canSkip) {
  ... skip related metrics and logging
}



--
To view, visit http://gerrit.cloudera.org:8080/21663
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I26933f98556736f66df986f9440ebb64be395bc1
Gerrit-Change-Number: 21663
Gerrit-PatchSet: 8
Gerrit-Owner: Sai Hemanth Gantasala <[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]>
Gerrit-Comment-Date: Thu, 09 Jan 2025 10:36:47 +0000
Gerrit-HasComments: Yes

Reply via email to