On Tue, Sep 22, 2026 at 3:31 PM Terry Wilson <[email protected]> wrote:
>
> Ordinarily the IDL finds out in advance whether a particular database is
> on its server, or it finds out via notifications.  But it's also a good
> idea to adopt a belt-and-suspenders approach so that, if the IDL does
> receive an "unknown database" error, we treat it as a "soft" error that
> can be fixed by reconnecting to another server, rather than a "hard"
> error that should cause an immediate abort.
>
> This is a Python port of C commit e83ea0d652f2 ("ovsdb-idl: Treat
> "unknown database" error as reason to reconnect.").  It relies on
> Idl.flag_inconsistency() to force the reconnect and full re-download.
>
> Assisted-by: Claude Opus 4.8
> Signed-off-by: Terry Wilson <[email protected]>
> ---
>  python/ovs/db/idl.py | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py
> index 342fa487c..dafeaff26 100644
> --- a/python/ovs/db/idl.py
> +++ b/python/ovs/db/idl.py
> @@ -2261,6 +2261,13 @@ class Transaction(object):
>                      if error is not None:
>                          if error == "timed out":
>                              soft_errors = True
> +                        elif error == "unknown database":
> +                            # ovsdb-server uses this error message to
> +                            # indicate that the database in question was
> +                            # removed, converted, etc.  Flag the IDL as
> +                            # inconsistent so it reconnects and resyncs.
> +                            self.idl.flag_inconsistency()
> +                            soft_errors = True
>                          elif error == "not owner":
>                              lock_errors = True
>                          elif error == "aborted":
> --
> 2.55.0
>

Fixes: e83ea0d652f2 ("ovsdb-idl: Treat "unknown database" error as
reason to reconnect.")

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to