From ec918adeb0e641d41ee2571fd717cad139d939ad Mon Sep 17 00:00:00 2001 From: Alberto Leiva Popper Date: Mon, 4 Dec 2023 17:25:38 -0300 Subject: [PATCH] Stop dropping old deltas when there are no new deltas __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. --- src/rtr/db/vrps.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/rtr/db/vrps.c b/src/rtr/db/vrps.c index 8f4015b0..3bfe42f6 100644 --- a/src/rtr/db/vrps.c +++ b/src/rtr/db/vrps.c @@ -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) -- 2.47.3