ankitsol commented on code in PR #7617:
URL: https://github.com/apache/hbase/pull/7617#discussion_r3074515880


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java:
##########
@@ -866,4 +866,24 @@ public long getTotalReplicatedEdits() {
   long getSleepForRetries() {
     return sleepForRetries;
   }
+
+  void restartShipper(String walGroupId, ReplicationSourceShipper oldWorker) {
+    workerThreads.compute(walGroupId, (key, current) -> {
+      if (current != oldWorker) {
+        return current; // already replaced

Review Comment:
   One scenario is concurrent restart attempts, very very rare chance though 
imho. For example, if the same worker encounters failure paths close together 
(or multiple threads trigger restart around the same time), one call to 
restartShipper may already replace the worker in workerThreads. When the second 
call executes, the current entry is no longer oldWorker, so we skip replacing 
it again.



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