Skip to content

Commit

Permalink
Stop dropping old deltas when there are no new deltas
Browse files Browse the repository at this point in the history
__vrps_update() wasn't properly differentiating between a validation
cycle that errored from one that generated no deltas. Both were being
handled as failure.

Therefore, Fort might have been inducing more RTR Cache Resets than it
was supposed to. Although, iterations in which no deltas are generated
seem to be rare.

The removal of surplus error propagation in the previous commit
revealed that compute_deltas() cannot actually fail, which made
the solution here trivial.
  • Loading branch information
ydahhrk committed Dec 4, 2023
1 parent cd59667 commit ec918ad
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/rtr/db/vrps.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,21 +225,11 @@ __vrps_update(bool *changed)
}

rwlock_write_lock(&state_lock);

state.base = new_base;
state.serial++;
if (new_deltas != NULL) {
if (new_deltas != NULL)
/* Ownership transferred */
darray_add(state.deltas, new_deltas);
} else {
/*
* If the latest base has no deltas, all existing deltas are
* rendered useless. This is because clients always want to
* reach the latest serial, no matter where they are.
*/
darray_clear(state.deltas);
}

rwlock_unlock(&state_lock);

if (old_base != NULL)
Expand Down

0 comments on commit ec918ad

Please sign in to comment.