The sequence is:
1. Exporter gets an add or change. Exporter processes it and adds it to the queue as an 'update'.
2. The queue 'update' has not been processed yet and exporter gets a delete and does the following:
} else if (state != NULL) {
// Link deletes must preceed node deletes. state->ClearValid(); <<<<<< has been cleared
if (!state->HasDependents()) { <<<<<< this is still true and so we skip the EnqueueDelete
// enqueue delete. EnqueueDelete(node, state);
if (state->update_list().empty()) { entry->ClearState(table, tinfo->id()); delete state;
}
}
}
We call ClearValid. But, HasDependents() returns true. So, we skip the enqueuing of the delete.
Now, the following code is executed on the queue side.
// Append the contents of the update-node to the message.
message_->EncodeUpdate(update);
// Clean up the node if everybody has seen it.
update->AdvertiseReset(base_send_set);
if (update->advertise().empty()) { queue_->Dequeue(update);
}
// Update may be freed.
server_->exporter()->StateUpdateOnDequeue(update, base_send_set, << update points to an 'update' and not a 'delete' update->IsDelete());
}
Then, in StateUpdateOnDequeue()
if (state->update_list().empty() && state->IsInvalid()) { <<<<<< both are true assert(state->advertised().empty());
The sequence is:
1. Exporter gets an add or change. Exporter processes it and adds it to the queue as an 'update'.
2. The queue 'update' has not been processed yet and exporter gets a delete and does the following:
} else if (state != NULL) {
state- >ClearValid( ); <<<<<< has been cleared >HasDependents( )) { <<<<<< this is still true and so we skip the EnqueueDelete
EnqueueDel ete(node, state); >update_ list(). empty() ) {
entry- >ClearState( table, tinfo->id());
delete state;
// Link deletes must preceed node deletes.
if (!state-
// enqueue delete.
if (state-
}
}
}
We call ClearValid. But, HasDependents() returns true. So, we skip the enqueuing of the delete.
Now, the following code is executed on the queue side.
void IFMapUpdateSend er::ProcessUpda te(IFMapUpdate *update,
const BitSet &base_send_set) { SentUpdate( update, base_send_set);
LogAndCount
// Append the contents of the update-node to the message. ->EncodeUpdate( update) ; >AdvertiseReset (base_send_ set); >advertise( ).empty( )) {
queue_ ->Dequeue( update) ; ->exporter( )->StateUpdateO nDequeue( update, base_send_set, << update points to an 'update' and not a 'delete'
update- >IsDelete( ));
message_
// Clean up the node if everybody has seen it.
update-
if (update-
}
// Update may be freed.
server_
}
Then, in StateUpdateOnDe queue()
if (state- >update_ list(). empty() && state->IsInvalid()) { <<<<<< both are true
assert( state-> advertised( ).empty( ));