palashc commented on code in PR #1666:
URL: https://github.com/apache/phoenix/pull/1666#discussion_r1342954480


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -5181,6 +5192,24 @@ private void flushTable(byte[] tableName) throws 
SQLException {
         }
     }
 
+    @Override
+    public void refreshLiveRegionServers() throws SQLException {
+        synchronized (liveRegionServersLock) {
+            try (Admin admin = getAdmin()) {
+                this.liveRegionServers = new 
ArrayList<>(admin.getRegionServers(true));
+            }
+            catch (IOException e) {
+                throw ServerUtil.parseServerException(e);
+            }
+        }
+        LOGGER.info("Refreshed list of live region servers.");
+    }
+
+    @Override
+    public List<ServerName> getLiveRegionServers() {
+        return this.liveRegionServers;

Review Comment:
   @shahrs87 I think a client getting a stale copy of region server list should 
be okay. It will pick another region server randomly which will likely be 
different from the regionserver which had issues. Also the list variable is 
`volatile` so that all threads will get the latest updated value. This weaker 
and light-weight form of synchronization should suffice for our purpose, most 
of the shared state in CQSI is handled this way. Let me know if I am missing 
something. 



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

Reply via email to