From 904f37548f3a8a0bb08579f74259e574a80243a4 Mon Sep 17 00:00:00 2001 From: Tapan Karwa Date: Mon, 8 Jun 2015 16:37:04 -0700 Subject: [PATCH] Calls to Node/LinkTableExport() from the exporter must pass the right partition Change-Id: Ibac50e27dd01b1cdf521ae86227f63b3c919411a Closes-Bug:1463204 --- src/ifmap/ifmap_exporter.cc | 18 ++++++++---------- src/ifmap/ifmap_exporter.h | 7 +++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/ifmap/ifmap_exporter.cc b/src/ifmap/ifmap_exporter.cc index da30834e13b..50f6254e11b 100644 --- a/src/ifmap/ifmap_exporter.cc +++ b/src/ifmap/ifmap_exporter.cc @@ -312,8 +312,7 @@ void IFMapExporter::MoveAdjacentNode(IFMapNodeState *state) { } } -void IFMapExporter::RemoveDependentLinks(DBTablePartBase *partition, - IFMapNodeState *state, +void IFMapExporter::RemoveDependentLinks(IFMapNodeState *state, const BitSet &rm_set) { for (IFMapNodeState::iterator iter = state->begin(), next = state->begin(); iter != state->end(); iter = next) { @@ -325,21 +324,20 @@ void IFMapExporter::RemoveDependentLinks(DBTablePartBase *partition, } BitSet common = ls->advertised() & rm_set; if (!common.empty()) { - LinkTableExport(partition, link); + LinkTableExport(link->get_table_partition(), link); } } } -void IFMapExporter::ProcessAdjacentNode( - DBTablePartBase *partition, IFMapNode *node, const BitSet &add_set, - IFMapNodeState *state) { +void IFMapExporter::ProcessAdjacentNode(IFMapNode *node, const BitSet &add_set, + IFMapNodeState *state) { BitSet current = state->advertised(); IFMapUpdate *update = state->GetUpdate(IFMapListEntry::UPDATE); if (update) { current |= update->advertise(); } if (!current.Contains(add_set)) { - NodeTableExport(partition, node); + NodeTableExport(node->get_table_partition(), node); } } @@ -398,7 +396,7 @@ void IFMapExporter::NodeTableExport(DBTablePartBase *partition, // For the subset of clients being removed, make sure that all // dependent links are removed before. if (!rm_set.empty()) { - RemoveDependentLinks(partition, state, rm_set); + RemoveDependentLinks(state, rm_set); } UpdateRemove(node, state, rm_set); } else if (state != NULL) { @@ -491,8 +489,8 @@ void IFMapExporter::LinkTableExport(DBTablePartBase *partition, rm_set.BuildComplement(state->advertised(), state->interest()); if (!add_set.empty()) { - ProcessAdjacentNode(partition, link->left(), add_set, s_left); - ProcessAdjacentNode(partition, link->right(), add_set, s_right); + ProcessAdjacentNode(link->left(), add_set, s_left); + ProcessAdjacentNode(link->right(), add_set, s_right); } UpdateAddChange(link, state, add_set, rm_set, false); diff --git a/src/ifmap/ifmap_exporter.h b/src/ifmap/ifmap_exporter.h index 8a93af0283b..13b2e7df2d4 100644 --- a/src/ifmap/ifmap_exporter.h +++ b/src/ifmap/ifmap_exporter.h @@ -80,11 +80,10 @@ class IFMapExporter { void EnqueueDelete(ObjectType *obj, IFMapState *state); void MoveDependentLinks(IFMapNodeState *state); - void RemoveDependentLinks(DBTablePartBase *partition, IFMapNodeState *state, - const BitSet &rm_set); + void RemoveDependentLinks(IFMapNodeState *state, const BitSet &rm_set); void MoveAdjacentNode(IFMapNodeState *state); - void ProcessAdjacentNode(DBTablePartBase *partition, IFMapNode *node, - const BitSet &add_set, IFMapNodeState *state); + void ProcessAdjacentNode(IFMapNode *node, const BitSet &add_set, + IFMapNodeState *state); bool IsFeasible(const IFMapNode *node);