Himanshu-g81 commented on code in PR #2598:
URL: https://github.com/apache/phoenix/pull/2598#discussion_r3789399945


##########
phoenix-core-server/src/main/java/org/apache/phoenix/replication/ReplicationLogDiscovery.java:
##########
@@ -196,6 +226,61 @@ public void stop() {
     LOG.info("ReplicationLogDiscovery stopped for haGroup: {}", haGroupName);
   }
 
+  /**
+   * Schedules the next replay as a single-shot task whose delay is recomputed 
each cycle via
+   * {@link #computeAlignedInitialDelay()}. Recomputing every cycle re-pins 
each wake-up to the
+   * wall-clock round-eligibility grid, correcting scheduler/wall-clock drift 
instead of letting a
+   * one-time misalignment persist for the life of the process (which 
fixed-rate scheduling does).
+   * All region servers still converge on the same grid, preserving 
PHOENIX-7813's shared wake-up.
+   */
+  @GuardedBy("this")
+  protected void scheduleNextReplay() {
+    long delayMs = computeAlignedInitialDelay();
+    // Bind this cycle to the current scheduler generation. A stop()->start() 
restart
+    // swaps in a new scheduler; a cycle launched on the old one must 
reschedule onto
+    // that same (now shut-down) scheduler, not the new one.
+    ScheduledExecutorService owner = scheduler;
+    LOG.info("Scheduling next replay for haGroup: {} in {}ms", haGroupName, 
delayMs);

Review Comment:
   Downgraded this one to DEBUG. I will review all the pre-existing once and 
will sweep the once which might be noise (based on experience with debugging 
during initial rounds of testing) to DEBUG/TRACE in a separate follow-up to 
keep scope of this PR limited, if that sounds good to you? or can fold that in 
here if you'd prefer.



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