Skip to content

Commit

Permalink
ovsdb-cs: Fix ignoring of the last id from the initial monitor reply.
Browse files Browse the repository at this point in the history
Current code doesn't use the last id received in the monitor reply.
That may result in re-downloading the database content if the
re-connection happened after receiving the initial monitor reply,
but before receiving any other database updates.

Fixes: 1c337c4 ("ovsdb-idl: Break into two layers.")
Reported-at: https://bugzilla.redhat.com/2044624
Acked-by: Mike Pattrick <[email protected]>
Acked-by: Han Zhou <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Jan 28, 2022
1 parent dadd835 commit 3a05c63
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ovsdb-cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,12 +1539,11 @@ ovsdb_cs_db_parse_monitor_reply(struct ovsdb_cs_db *db,
const struct json *table_updates;
bool clear;
if (version == 3) {
struct uuid last_id;
if (result->type != JSON_ARRAY || result->array.n != 3
|| (result->array.elems[0]->type != JSON_TRUE &&
result->array.elems[0]->type != JSON_FALSE)
|| result->array.elems[1]->type != JSON_STRING
|| !uuid_from_string(&last_id,
|| !uuid_from_string(&db->last_id,
json_string(result->array.elems[1]))) {
struct ovsdb_error *error = ovsdb_syntax_error(
result, NULL, "bad monitor_cond_since reply format");
Expand Down

0 comments on commit 3a05c63

Please sign in to comment.