[ovs-dev] [PATCH 2/2] Implement database schema versioning.
Jeremy Stribling
strib at nicira.com
Mon Dec 27 19:34:06 UTC 2010
On 12/22/2010 12:51 PM, Ben Pfaff wrote:
> As the database schema evolves, it might be useful to have an identifier
> for the particular version in use. This commit adds that feature.
> ---
> ovsdb/SPECS | 12 ++++++++++++
> ovsdb/ovsdb-client.1.in | 15 +++++++++++++++
> ovsdb/ovsdb-client.c | 9 +++++++++
> ovsdb/ovsdb-tool.1.in | 29 +++++++++++++++++++++++++++++
> ovsdb/ovsdb-tool.c | 26 ++++++++++++++++++++++++++
> ovsdb/ovsdb.c | 37 ++++++++++++++++++++++++++++++++-----
> ovsdb/ovsdb.h | 4 +++-
> python/ovs/db/schema.py | 25 +++++++++++++++++++------
> tests/idltest.ovsschema | 3 ++-
> tests/ovsdb-execution.at | 3 ++-
> tests/ovsdb-schema.at | 26 +++++++++++++++++++++++++-
> tests/ovsdb-server.at | 13 ++++++++++++-
> tests/ovsdb-tool.at | 20 +++++++++++++++++++-
> vswitchd/automake.mk | 12 ++++++++++++
> vswitchd/vswitch.ovsschema | 5 +++++
> vswitchd/vswitch.xml | 21 +++++++++++++++++++++
> xenserver/etc_init.d_openvswitch | 11 ++++++++++-
> 17 files changed, 253 insertions(+), 18 deletions(-)
>
> diff --git a/ovsdb/SPECS b/ovsdb/SPECS
> index 326293c..6d395be 100644
> --- a/ovsdb/SPECS
> +++ b/ovsdb/SPECS
> @@ -33,6 +33,11 @@ values. Additional notation is presented later.
> <id>s that begin with _ are reserved to the implementation and may
> not be used by the user.
>
> +<version>
> +
> + A JSON string that contains a version number that matches
> + [0-9]+\.[0-9]+\.[0-9]+
> +
> <boolean>
>
> A JSON true or false value.
> @@ -102,6 +107,7 @@ is represented by<database-schema>, as described below.
> A JSON object with the following members:
>
> "name":<id> required
> + "version":<version> required
> "tables": {<id>:<table-schema>, ...} required
>
> The "name" identifies the database as a whole. It must be
> @@ -109,6 +115,12 @@ is represented by<database-schema>, as described below.
> operated on. The value of "tables" is a JSON object whose names
> are table names and whose values are<table-schema>s.
>
> + The "version" reports the version of the database schema. This is
> + a recent addition to the schema format, so OVSDB permits it to be
> + absent. This is deprecated and may be removed in the future.
> + Open vSwitch semantics for "version" are described in
> + ovs-vswitchd.conf.db(5).
> +
>
How is it that "version" is both recent and deprecated? Should a new
app use this to get the version or not?
Everything else looks good to me (documentation- and semantic-wise -- I
didn't look at the code).
More information about the dev
mailing list