Message ID | 20211219140941.2279071-2-i.maximets@ovn.org |
---|---|
State | Accepted |
Commit | 3a05c63702a58c0e1482d6ba83099c8443cb89cd |
Headers | show |
Series | ovsdb: Bug fixes + Relay txn history and performance. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
Hello Ilya, LGTM! Acked-by: Mike Pattrick <mkp@redhat.com> On Sun, 2021-12-19 at 15:09 +0100, Ilya Maximets wrote: > 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: 1c337c43ac1c ("ovsdb-idl: Break into two layers.") > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > --- > lib/ovsdb-cs.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c > index fcb6fe1b3..2d2b77026 100644 > --- a/lib/ovsdb-cs.c > +++ b/lib/ovsdb-cs.c > @@ -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");
On Sun, Dec 19, 2021 at 6:09 AM Ilya Maximets <i.maximets@ovn.org> wrote: > > 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: 1c337c43ac1c ("ovsdb-idl: Break into two layers.") > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > --- > lib/ovsdb-cs.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c > index fcb6fe1b3..2d2b77026 100644 > --- a/lib/ovsdb-cs.c > +++ b/lib/ovsdb-cs.c > @@ -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"); > -- > 2.31.1 > Thanks Ilya. Acked-by: Han Zhou <hzhou@ovn.org>
On 1/25/22 02:27, Han Zhou wrote: > > > On Sun, Dec 19, 2021 at 6:09 AM Ilya Maximets <i.maximets@ovn.org <mailto:i.maximets@ovn.org>> wrote: >> >> 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: 1c337c43ac1c ("ovsdb-idl: Break into two layers.") >> Signed-off-by: Ilya Maximets <i.maximets@ovn.org <mailto:i.maximets@ovn.org>> >> --- >> lib/ovsdb-cs.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c >> index fcb6fe1b3..2d2b77026 100644 >> --- a/lib/ovsdb-cs.c >> +++ b/lib/ovsdb-cs.c >> @@ -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"); >> -- >> 2.31.1 >> > > Thanks Ilya. > Acked-by: Han Zhou <hzhou@ovn.org <mailto:hzhou@ovn.org>> Thanks, Han and Mike! Applied and backported down to 2.15. Bets regards, Ilya Maximets.
diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c index fcb6fe1b3..2d2b77026 100644 --- a/lib/ovsdb-cs.c +++ b/lib/ovsdb-cs.c @@ -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");
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: 1c337c43ac1c ("ovsdb-idl: Break into two layers.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- lib/ovsdb-cs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)