[VOL-3736]: Bug - Restarting multicast iperf server (at RG) will not restore the data stream at the RG.
- Use the right flow id when clearing mcast flow
- Fix UT
Change-Id: Ib392f0ec8fb62b7124774108fb507438ad00f14d
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index d9ffa7a..abaa97b 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -2051,7 +2051,7 @@
}
if !flowInfo.Flow.ReplicateFlow {
if err = f.clearResources(ctx, flow, Intf, onuID, uniID, flowInfo.Flow.GemportId, flowInfo.Flow.FlowId, portNum); err != nil {
- logger.Error(ctx, "failed-to-clear-resources-for-flow", log.Fields{
+ logger.Errorw(ctx, "failed-to-clear-resources-for-flow", log.Fields{
"flow-id": flow.Id,
"stored-flow": flowInfo.Flow,
"device-id": f.deviceHandler.device.Id,
@@ -2069,7 +2069,7 @@
logger.Debugw(ctx, "gems-to-be-cleared", log.Fields{"gems": gems})
for _, gem := range gems {
if err = f.clearResources(ctx, flow, Intf, onuID, uniID, int32(gem), flowInfo.Flow.FlowId, portNum); err != nil {
- logger.Error(ctx, "failed-to-clear-resources-for-flow", log.Fields{
+ logger.Errorw(ctx, "failed-to-clear-resources-for-flow", log.Fields{
"flow-id": flow.Id,
"stored-flow": flowInfo.Flow,
"device-id": f.deviceHandler.device.Id,
@@ -3297,7 +3297,6 @@
var onuID = int32(NoneOnuID)
var uniID = int32(NoneUniID)
- var flowID uint64
if flowInfo = f.resourceMgr.GetFlowIDInfo(ctx, networkInterfaceID, onuID, uniID, flow.Id); flowInfo == nil {
return olterrors.NewErrPersistence("remove", "flow", flow.Id,
log.Fields{
@@ -3322,7 +3321,7 @@
return err
}
// Remove flow from KV store
- return f.resourceMgr.RemoveFlowIDInfo(ctx, networkInterfaceID, onuID, uniID, flowID)
+ return f.resourceMgr.RemoveFlowIDInfo(ctx, networkInterfaceID, onuID, uniID, flow.Id)
}
// reconcileSubscriberDataPathFlowIDMap reconciles subscriberDataPathFlowIDMap from KV store