On Fri, Feb 12, 2010 at 12:31 PM, Balazs Lecz <[email protected]> wrote: > After an instance migration or failover some nodes will > have stale routing information and these will continue to send traffic > to the old node. This is detected by ganeti-nld on the old node. > > This patch adds the capability to look up the source node based on the > source instance IP. > > Signed-off-by: Balazs Lecz <[email protected]> > --- > daemons/ganeti-nld | 30 +++++++++++++++++++++++++++--- > 1 files changed, 27 insertions(+), 3 deletions(-) > > diff --git a/daemons/ganeti-nld b/daemons/ganeti-nld > index efdf11a..0beafe5 100755 > --- a/daemons/ganeti-nld > +++ b/daemons/ganeti-nld > @@ -388,12 +388,36 @@ class MisroutedPacketHandler(object): > self.instance_node_maps = instance_node_maps > > def __call__(self, i, nflog_payload): > + # Look up the source IP in the instance->node maps. If found, it means > the > + # packet came from an instance in one of our clusters, which means the > + # node it's running on has stale routing information, so we have to > + # notify that node. > ip_packet = ip.disassemble(nflog_payload.get_data()) > - logging.debug("misrouted packet detected. source IP: %s", ip_packet.src) > + > + source_cluster = None > + source_link = None > + source_node = None > + for cluster, cluster_map in self.instance_node_maps.iteritems():
If theoretically we had the same IP on separate clusters, you would want to first check the link it came from, and choose the right cluster based on that. Thanks, Guido
