@@ -755,20 +755,15 @@ defmodule Nebulex.Adapters.Replicated.Bootstrap do
755755
756756 nodes ->
757757 # Sync process:
758- # 1. Push a new generation on all cluster nodes to make the newer one
759- # empty.
760- # 2. Copy cached data from one of the cluster nodes; entries will be
761- # streamed from the older generation since the newer one should be
762- # empty.
763- # 3. Push a new generation on the current/new node to make it a mirror
764- # of the other cluster nodes.
765- # 4. Reset GC timer for ell cluster nodes (making the generation timer
766- # gap among cluster nodes as small as possible).
767- with :ok <- maybe_run_on_nodes ( adapter_meta , nodes , :new_generation ) ,
768- :ok <- copy_entries_from_nodes ( adapter_meta , nodes ) ,
769- :ok <- maybe_run_on_nodes ( adapter_meta , [ node ( ) ] , :new_generation ) do
770- maybe_run_on_nodes ( adapter_meta , nodes , :reset_generation_timer )
771- end
758+ #
759+ # 1. Copy cached data from existing cluster nodes to the joining node.
760+ # At this point, both the newer and older generations are still present,
761+ # so data may be copied from both, ensuring no data is lost due to premature
762+ # generation rotation.
763+ # 2. Reset the generation GC timer on all nodes to synchronize their GC intervals,
764+ # minimizing timer gaps and ensuring consistent generation rotation across the cluster.
765+ :ok = copy_entries_from_nodes ( adapter_meta , nodes )
766+ maybe_run_on_nodes ( adapter_meta , cluster_nodes , :reset_generation_timer )
772767 end
773768 end
774769
0 commit comments