ovsdb-idl: Tolerate missing tables and columns.
authorBen Pfaff <blp@nicira.com>
Fri, 20 Mar 2015 06:45:42 +0000 (23:45 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 1 Apr 2015 00:10:58 +0000 (17:10 -0700)
commitd18e52e3d97ee160b19a55927876423add24a13a
treed9138820b39a9c6d68167abfb5655c6fa31d87c9
parentda1e25d5af82d0d17fa9560cb8bb3a29afcd7818
ovsdb-idl: Tolerate missing tables and columns.

Until now, if ovs-vsctl (or another client of the C ovsdb-idl library) was
compiled against a schema that had a column or table that was not in the
database actually being used (e.g. during an upgrade), and the column or
table was selected for monitoring, then ovsdb-idl would fail to get any
data at all because ovsdb-server would report an error due to a request
about a column or a table it didn't know about.

This commit fixes the problem by making ovsdb-idl retrieve the database
schema from the database server and omit any tables or columns that don't
exist from its monitoring request.  This works OK for the kinds of upgrades
that OVSDB otherwise supports gracefully because it will simply make the
missing columns or tables appear empty, which clients of the ovsdb-idl
library already have to tolerate.

VMware-BZ: #1413562
Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
lib/ovsdb-idl.c
lib/ovsdb-parser.c
lib/ovsdb-parser.h
tests/automake.mk
tests/idltest2.ovsschema [new file with mode: 0644]
tests/ovsdb-idl.at