stoty commented on code in PR #1927:
URL: https://github.com/apache/phoenix/pull/1927#discussion_r1714755838
##########
phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -5125,6 +5136,35 @@ void ensureSystemTablesMigratedToSystemNamespace()
}
}
+ /**
+ * Acquire distributed mutex of sorts to make sure only one JVM is able to
run the upgrade code by
+ * making use of HBase's checkAndPut api.
+ *
+ * @return true if client won the race, false otherwise
+ * @throws SQLException
+ */
+ @VisibleForTesting
+ public boolean checkUpgradeBlockMutex()
+ throws SQLException {
+ try (Table sysMutexTable = getSysMutexTable()) {
+ final byte[] rowKey = Bytes.toBytes("BLOCK_UPGRADE");
+
+ byte[] family =
PhoenixDatabaseMetaData.SYSTEM_MUTEX_FAMILY_NAME_BYTES;
Review Comment:
Nit: Maybe using the constants directly in the call would be easier to read ?
--
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]