ritegarg commented on code in PR #2313:
URL: https://github.com/apache/phoenix/pull/2313#discussion_r2529072561
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/PhoenixRegionServerEndpoint.java:
##########
@@ -224,17 +236,44 @@ private void startHAGroupStoreClientPrewarming() {
});
prewarmExecutor.submit(() -> {
- try {
- HAGroupStoreManager manager =
HAGroupStoreManager.getInstance(conf);
- if (manager == null) {
- LOGGER.warn("HAGroupStoreManager is null, skipping
prewarming");
+ HAGroupStoreManager manager = null;
+ List<String> pending = null;
+ // Phase 1: Retry indefinitely until HAGroupStoreManager is
initialized
+ // and HAGroupNames are retrieved.
+ while (pending == null) {
+ try {
+ manager = HAGroupStoreManager.getInstance(conf);
+ if (manager != null) {
+ pending = new ArrayList<>(manager.getHAGroupNames());
+ LOGGER.info("Starting prewarming for {}
HAGroupStoreClients",
+ pending.size());
+ } else {
+ LOGGER.debug("HAGroupStoreManager is null, retrying in
2s...");
+ }
+
+ if (pending == null) {
Review Comment:
Removed, it also handled case when manager is null, added that explicitly now
--
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]