From: Alberto Leiva Popper Date: Mon, 4 Dec 2023 20:25:38 +0000 (-0300) Subject: Stop dropping old deltas when there are no new deltas X-Git-Tag: 1.6.1~10 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec918adeb0e641d41ee2571fd717cad139d939ad;p=thirdparty%2FFORT-validator.git 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. --- 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)