Page MenuHomeVyOS Platform

Bug in weight calculation for failover mode
Closed, InvalidPublicBUG

Description

Possible fix for correction:

diff --git a/src/lbdecision.cc b/src/lbdecision.cc
index a5c334e..2005585 100644
--- a/src/lbdecision.cc
+++ b/src/lbdecision.cc
@@ -572,9 +572,11 @@ LBDecision::get_new_weights(LBData &data, LBRule &rule)
 	    w_iter->second = 0.; //zero out previous weight
 	    ++w_iter;
 	  }
+	  weights.insert(pair<string,float>(iter->first,iter->second));
+	  group = iter->second;
+	} else {
+	  weights.insert(pair<string,float>(iter->first,0.));
 	}
-	weights.insert(pair<string,float>(iter->first,iter->second));
-	group = iter->second;
       }
       else {
 	weights.insert(pair<string,float>(iter->first,0.));

Details

Version
1.3
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

@banditos13 Can you describe more details?
What is the bug and how to reproduce it?

In failover mode only one active channel with "best parameters" can be used for connections

@banditos13 can you send a link to the file, which you suggest to fix, or create PR?

Вячеслав @Viacheslav, я не понял вопроса...
В шапке таска лежит рабочий патч

erkin renamed this task from Bug in weigt calculation for failover mode to Bug in weight calculation for failover mode.Aug 29 2021, 1:06 PM
erkin set Issue type to Bug (incorrect behavior).
erkin removed a subscriber: Global Notifications.
dmbaturin removed projects: Restricted Project, VyOS 1.4 Sagitta (1.4.1).
dmbaturin subscribed.

We never received any info about what the incorrect behavior in question is, and the load balancing subsystem is undergoing a rewrite, so I'm closing this.