dengzhhu653 commented on a change in pull request #1078:
URL: https://github.com/apache/hive/pull/1078#discussion_r437783154
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
##########
@@ -7109,22 +7121,37 @@ protected String describeResult() {
}
@Override
- public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(
- String principalName, PrincipalType principalType) {
- try (QueryWrapper queryWrapper = new QueryWrapper()) {
- return convertDB(listPrincipalAllDBGrant(principalName, principalType,
queryWrapper));
+ public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(String
principalName, PrincipalType principalType) {
+ List<HiveObjectPrivilege> results = Collections.emptyList();
+ try {
+ openTransaction();
+ results = convertDB(listPrincipalAllDBGrant(principalName,
principalType));
+ commitTransaction();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ rollbackAndCleanup(true, null);
Review comment:
https://github.com/apache/hive/blob/871ee8009380e1bab160b58dc378a7f668c64584/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java#L11729-L11739
I'm wondering that the opened transaction may be unable to be committed when
exception happens on ```listPrincipalAllDBGrant``` or rolled back as we set
the ```success``` to true on the method ```rollbackAndCleanup```. Could you
explain more about why set ```success``` to true here? Thanks @belugabehr
----------------------------------------------------------------
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]