File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,6 @@ void NVMeofGwMon::on_shutdown()
6666
6767void NVMeofGwMon::tick ()
6868{
69- if (++tick_ratio == 10 ) {
70- global_rebalance_index++;
71- dout (20 ) << " rebalance index " << global_rebalance_index << dendl;
72- tick_ratio = 0 ;
73- }
7469 if (!is_active () || !mon.is_leader ()) {
7570 dout (10 ) << " NVMeofGwMon leader : " << mon.is_leader ()
7671 << " active : " << is_active () << dendl;
@@ -329,8 +324,9 @@ bool NVMeofGwMon::preprocess_command(MonOpRequestRef op)
329324 if (HAVE_FEATURE (mon.get_quorum_con_features (), NVMEOFHA)) {
330325 f->dump_string (" features" , " LB" );
331326 if (map.created_gws [group_key].size ()) {
332- uint32_t index = (global_rebalance_index %
333- map.created_gws [group_key].size ()) + 1 ;
327+ time_t seconds_since_1970 = time (NULL );
328+ uint32_t index = ((seconds_since_1970/60 ) %
329+ map.created_gws [group_key].size ()) + 1 ;
334330 f->dump_unsigned (" rebalance_ana_group" , index);
335331 }
336332 }
Original file line number Diff line number Diff line change @@ -83,9 +83,6 @@ class NVMeofGwMon: public PaxosService,
8383 void check_sub (Subscription *sub);
8484
8585private:
86- // used for calculate pool & group GW responsible for rebalance
87- uint32_t global_rebalance_index = 1 ;
88- uint8_t tick_ratio = 0 ;
8986 void synchronize_last_beacon ();
9087 void process_gw_down (const NvmeGwId &gw_id,
9188 const NvmeGroupKey& group_key, bool &propose_pending,
You can’t perform that action at this time.
0 commit comments