VOL-1861: Disable the check for backend bindings.
The check is not required as backends are pre-configured.
This will allow backend references to be re-used on ofagent restarts.
Change-Id: I7520cad7dd2a60cf722244e90674d109679fff93
(cherry picked from commit 33213ff1c5b94dfd1b90c610829d8fae11c74d18)
diff --git a/afrouter/afrouter/binding-router.go b/afrouter/afrouter/binding-router.go
index 715cc4c..f545a9d 100644
--- a/afrouter/afrouter/binding-router.go
+++ b/afrouter/afrouter/binding-router.go
@@ -102,24 +102,16 @@
return nil, nil
}
log.Debugf("MUST CREATE A NEW BINDING MAP ENTRY!!")
- if len(br.bindings) < len(br.beCluster.backends) {
- if *br.currentBackend, err = br.beCluster.nextBackend(*br.currentBackend, BackendSequenceRoundRobin); err == nil {
- // Use the name of the backend as the metaVal for this new binding
- br.bindings[(*br.currentBackend).name] = *br.currentBackend
- return *br.currentBackend, nil
- } else {
- log.Error(err)
- sl.err = err
- return nil, nil
- }
+ if *br.currentBackend, err = br.beCluster.nextBackend(*br.currentBackend, BackendSequenceRoundRobin); err == nil {
+ // Use the name of the backend as the metaVal for this new binding
+ br.bindings[(*br.currentBackend).name] = *br.currentBackend
+ return *br.currentBackend, nil
} else {
- err = errors.New(fmt.Sprintf("Backends exhausted in attempt to bind for metakey '%s' with value '%s'",
- sl.metaKey, sl.metaVal))
log.Error(err)
sl.err = err
+ return nil, nil
}
}
- return nil, nil
default:
return nil, nil
}