diff mbox series

[ovs-dev,v1] ovs-lib: Fix standalone db migration to raft

Message ID 20190820013613.94682-1-aginwala@ebay.com
State Accepted
Commit 1a3f3cf8acc26266ff78fb36bd0bb5d094783088
Headers show
Series [ovs-dev,v1] ovs-lib: Fix standalone db migration to raft | expand

Commit Message

aginwala aginwala Aug. 20, 2019, 1:36 a.m. UTC
Current code of create-cluster from standalone db takes backup of existing
standalone db and then generates a new clustered dbs from backup dbs. Hence,
during migration if nb and sb  dbs are still present, create-cluster will fail
saying file exists and will not really convert  dbs to clustered dbs. This
patch fixes the same.

e.g message that pops up while migration from standalone to raft cluster:
 * Backing up database to /etc/openvswitch/ovnnb_db.db.backup5.13.0-1278623084
ovsdb-tool: I/O error: /etc/openvswitch/ovnnb_db.db: create failed (File exists)
 * Creating cluster database /etc/openvswitch/ovnnb_db.db from existing one

Signed-off-by: aginwala <aginwala@ebay.com>
---
 utilities/ovs-lib.in | 1 +
 1 file changed, 1 insertion(+)

Comments

0-day Robot Aug. 20, 2019, 1:59 a.m. UTC | #1
Bleep bloop.  Greetings Aliasgar Ginwala, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Aliasgar Ginwala <amginwal@gmail.com> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: aginwala <aginwala@ebay.com>
Lines checked: 36, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
Han Zhou Aug. 20, 2019, 6:20 p.m. UTC | #2
On Mon, Aug 19, 2019 at 6:36 PM Aliasgar Ginwala <amginwal@gmail.com> wrote:
>
> Current code of create-cluster from standalone db takes backup of existing
> standalone db and then generates a new clustered dbs from backup dbs.
Hence,
> during migration if nb and sb  dbs are still present, create-cluster will
fail
> saying file exists and will not really convert  dbs to clustered dbs. This
> patch fixes the same.
>
> e.g message that pops up while migration from standalone to raft cluster:
>  * Backing up database to
/etc/openvswitch/ovnnb_db.db.backup5.13.0-1278623084
> ovsdb-tool: I/O error: /etc/openvswitch/ovnnb_db.db: create failed (File
exists)
>  * Creating cluster database /etc/openvswitch/ovnnb_db.db from existing
one
>
> Signed-off-by: aginwala <aginwala@ebay.com>
> ---
>  utilities/ovs-lib.in | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
> index fa840ec63..76ce79b9c 100644
> --- a/utilities/ovs-lib.in
> +++ b/utilities/ovs-lib.in
> @@ -485,6 +485,7 @@ create_cluster () {
>      elif ovsdb_tool db-is-standalone "$DB_FILE"; then
>          # Convert standalone database to clustered.
>          backup_db || return 1
> +        rm -f "$DB_FILE"
>          action "Creating cluster database $DB_FILE from existing one" \
>                 ovsdb_tool create-cluster "$DB_FILE" "$backup"
"$LOCAL_ADDR"
>      fi
> --
> 2.20.1 (Apple Git-117)
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Thanks Aliasgar.

Acked-by: Han Zhou <hzhou8@ebay.com>
Ben Pfaff Aug. 21, 2019, 5:39 p.m. UTC | #3
On Mon, Aug 19, 2019 at 06:36:13PM -0700, Aliasgar Ginwala wrote:
> Current code of create-cluster from standalone db takes backup of existing
> standalone db and then generates a new clustered dbs from backup dbs. Hence,
> during migration if nb and sb  dbs are still present, create-cluster will fail
> saying file exists and will not really convert  dbs to clustered dbs. This
> patch fixes the same.
> 
> e.g message that pops up while migration from standalone to raft cluster:
>  * Backing up database to /etc/openvswitch/ovnnb_db.db.backup5.13.0-1278623084
> ovsdb-tool: I/O error: /etc/openvswitch/ovnnb_db.db: create failed (File exists)
>  * Creating cluster database /etc/openvswitch/ovnnb_db.db from existing one
> 
> Signed-off-by: aginwala <aginwala@ebay.com>

Thanks, applied to master and backported.
diff mbox series

Patch

diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index fa840ec63..76ce79b9c 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -485,6 +485,7 @@  create_cluster () {
     elif ovsdb_tool db-is-standalone "$DB_FILE"; then
         # Convert standalone database to clustered.
         backup_db || return 1
+        rm -f "$DB_FILE"
         action "Creating cluster database $DB_FILE from existing one" \
                ovsdb_tool create-cluster "$DB_FILE" "$backup" "$LOCAL_ADDR"
     fi