pvary commented on a change in pull request #2323:
URL: https://github.com/apache/hive/pull/2323#discussion_r640364312



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -5269,6 +5293,32 @@ private void preDropStorageDescriptor(MStorageDescriptor 
msd) {
     removeUnusedColumnDescriptor(mcd);
   }
 
+  /**
+   * Get a list of storage descriptors that reference a particular Column 
Descriptor
+   * @param oldCD the column descriptor to get storage descriptors for
+   * @return a list of storage descriptors
+   */
+  private List<MStorageDescriptor> 
listStorageDescriptorsWithCD(MColumnDescriptor oldCD, Query query) {
+    boolean success = false;
+    List<MStorageDescriptor> sds = null;
+    try {
+      openTransaction();

Review comment:
       Transactions could be used also to prevent other queries modifying the 
data which was read by another transaction depending on the isolation level 
used (for SERIALIZABLE isolation level). [One good 
description](https://www.sqlservercentral.com/articles/isolation-levels-in-sql-server)
   
   If there are concurrent transactions that could be an issue:
   - T1 reads the data - decides that the CD is not used anymore
   - T2 inserts a new row
   - T1 drops the CD
   
   The previous version of the code read the data inside the transaction, we 
can change the behavior if we decide so, but that has to be a conscious 
decision.
   
   IMHO this is all theoretical since if I remember correctly the 
`openTransaction()` is called before this method call, so in our case the new 
`openTranscation()` call just increments a counter.




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to