Skip to content

Commit

Permalink
Calls to Node/LinkTableExport() from the exporter must pass the right…
Browse files Browse the repository at this point in the history
… partition

Change-Id: Ibac50e27dd01b1cdf521ae86227f63b3c919411a
Closes-Bug:1463204
  • Loading branch information
tkarwa committed Jun 8, 2015
1 parent 2029bd2 commit 3f6fcd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
18 changes: 8 additions & 10 deletions src/ifmap/ifmap_exporter.cc
Expand Up @@ -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) {
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -492,8 +490,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);
Expand Down
7 changes: 3 additions & 4 deletions src/ifmap/ifmap_exporter.h
Expand Up @@ -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);

Expand Down

0 comments on commit 3f6fcd4

Please sign in to comment.