veghlaci05 commented on code in PR #4384:
URL: https://github.com/apache/hive/pull/4384#discussion_r1310044406
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -2502,40 +2546,22 @@ public void seedTxnId(SeedTxnIdRequest rqst) throws
MetaException {
@Override
@RetrySemantics.Idempotent
- public void addWriteNotificationLog(ListenerEvent acidWriteEvent)
- throws MetaException {
- Connection dbConn = null;
- try {
- try {
- //Idempotent case is handled by notify Event
- lockInternal();
- dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
-
MetaStoreListenerNotifier.notifyEventWithDirectSql(transactionalListeners,
- acidWriteEvent instanceof AcidWriteEvent ?
EventMessage.EventType.ACID_WRITE
- : EventMessage.EventType.BATCH_ACID_WRITE,
- acidWriteEvent, dbConn, sqlGenerator);
- LOG.debug("Going to commit");
- dbConn.commit();
- } catch (SQLException e) {
- LOG.debug("Going to rollback: ", e);
- rollbackDBConn(dbConn);
- if (isDuplicateKeyError(e)) {
- // in case of key duplicate error, retry as it might be because of
race condition
- if (waitForRetry("addWriteNotificationLog(" + acidWriteEvent + ")",
e.getMessage())) {
- throw new RetryException();
- }
- retryNum = 0;
- throw new MetaException(e.getMessage());
+ public void addWriteNotificationLog(ListenerEvent acidWriteEvent) throws
MetaException {
+ retryHandler.executeWithRetry(new RetryCallProperties()
Review Comment:
Fixed. Added the `@Retry` annotation and removed the explicit retryHandler
call. Before I got the idea of creating the annotation and the
`RetryingTxnHandler` proxy, this was the way of using the `RetryHandler`. It's
a remnant of the old approach.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]