veghlaci05 commented on code in PR #4384:
URL: https://github.com/apache/hive/pull/4384#discussion_r1293134630
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java:
##########
@@ -1046,37 +290,14 @@ public void cleanEmptyAbortedAndCommittedTxns() throws
MetaException {
*/
@Override
@RetrySemantics.Idempotent
- public void revokeFromLocalWorkers(String hostname) throws MetaException {
- try {
- Connection dbConn = null;
- Statement stmt = null;
- try {
- dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED,
connPoolCompaction);
- stmt = dbConn.createStatement();
- String s = "UPDATE \"COMPACTION_QUEUE\" SET \"CQ_WORKER_ID\" = NULL,
\"CQ_START\" = NULL, \"CQ_STATE\" = '"
- + INITIATED_STATE+ "' WHERE \"CQ_STATE\" = '" + WORKING_STATE + "'
AND \"CQ_WORKER_ID\" LIKE '"
- + hostname + "%'";
- LOG.debug("Going to execute update <{}>", s);
- // It isn't an error if the following returns no rows, as the local
workers could have died
- // with nothing assigned to them.
- int updated = stmt.executeUpdate(s);
- LOG.debug("Set {} compaction queue entries to {} state for host {}",
updated, INITIATED_RESPONSE, hostname);
- LOG.debug("Going to commit");
- dbConn.commit();
- } catch (SQLException e) {
- LOG.error("Unable to change dead worker's records back to initiated
state " +
- e.getMessage());
- LOG.debug("Going to rollback");
- rollbackDBConn(dbConn);
- checkRetryable(e, "revokeFromLocalWorkers(hostname:" + hostname +")");
- throw new MetaException(DB_FAILED_TO_CONNECT + e.getMessage());
- } finally {
- closeStmt(stmt);
- closeDbConn(dbConn);
- }
- } catch (RetryException e) {
- revokeFromLocalWorkers(hostname);
- }
+ public void revokeFromLocalWorkers(String hostname) {
+ dataSourceWrapper.getJdbcTemplate().update(
+ "UPDATE \"COMPACTION_QUEUE\" SET \"CQ_WORKER_ID\" = NULL, \"CQ_START\"
= NULL," +
Review Comment:
Answered above, if necessary I can resture the constant here as well
--
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]