tkhurana commented on code in PR #2018:
URL: https://github.com/apache/phoenix/pull/2018#discussion_r1817057440


##########
phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -2249,7 +2249,9 @@ private boolean ensureViewIndexTableDropped(byte[] 
physicalTableName, long times
                     final ReadOnlyProps props = this.getProps();
                     final boolean dropMetadata = 
props.getBoolean(DROP_METADATA_ATTRIB, DEFAULT_DROP_METADATA);
                     if (dropMetadata) {
-                        admin.disableTable(physicalIndexTableName);
+                        if (admin.isTableEnabled(physicalIndexTableName)) {
+                            admin.disableTable(physicalIndexTableName);

Review Comment:
   There is a race condition here because there is a window between the check 
if the table is enabled and the actual disable table call. It would be better 
if you make the disable table call itself resilient and gracefully handle the 
case where the table is already disabled. Calling disable on a table that is 
already disabled should be a no-op. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to