kishendas commented on a change in pull request #1095:
URL: https://github.com/apache/hive/pull/1095#discussion_r439255107



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/ColStatsProcessor.java
##########
@@ -188,9 +189,11 @@ public int persistColumnStats(Hive db, Table tbl) throws 
HiveException, MetaExce
     HiveTxnManager txnMgr = AcidUtils.isTransactionalTable(tbl)
         ? SessionState.get().getTxnMgr() : null;
     if (txnMgr != null) {
-      request.setValidWriteIdList(AcidUtils.getTableValidWriteIdList(conf,
-          AcidUtils.getFullTableName(tbl.getDbName(), 
tbl.getTableName())).toString());
       request.setWriteId(txnMgr.getAllocatedTableWriteId(tbl.getDbName(), 
tbl.getTableName()));
+      ValidWriteIdList writeId = AcidUtils.getTableValidWriteIdList(conf,
+          AcidUtils.getFullTableName(tbl.getDbName(), tbl.getTableName()));
+      writeId.locallyCommitWriteId(request.getWriteId());

Review comment:
       None of this is optimization. It's more of a correctness thing. I mean 
with HA, there can be multiple instances of Cache ( CachedStore or CatalogD ) 
and multiple instances of HMS. Locally committing the write Id will ensure that 
this write Id is included in the subsequent get_* methods, which would 
invalidate the cache and fetch the latest from backing DB. 




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