2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovsdb-idl: log error in client when db schema does not exist on server

A common error scenario with OVN is to attempt to use ovn-nbctl when
the OVN databases have not been created in ovsdb-server:
   1. ovn-nbctl sends "get_schema" request for OVN db to ovsdb-server.
   2. ovsdb-server fails to find requested db, sends error response
      to ovn-nbctl.
   3. ovn-nbctl receives the error response in ovsdb_idl_run(), but
      takes no specific action.
   4. ovn-nbctl hangs forever in IDL_S_SCHEMA_REQUESTED state (assuming
      a timeout wasn't requested on the command line).

Add a log message to inform the user of this situation.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Lance Richardson
2016-01-28 09:26:55 -05:00
committed by Ben Pfaff
parent eea0cdb5c5
commit 8e7baed053

View File

@@ -453,6 +453,14 @@ ovsdb_idl_run(struct ovsdb_idl *idl)
ovsdb_idl_send_monitor_request(idl);
idl->state = IDL_S_MONITOR_REQUESTED;
}
} else if (msg->type == JSONRPC_ERROR
&& idl->state == IDL_S_SCHEMA_REQUESTED
&& idl->request_id
&& json_equal(idl->request_id, msg->id)) {
json_destroy(idl->request_id);
idl->request_id = NULL;
VLOG_ERR("%s: requested schema not found",
jsonrpc_session_get_name(idl->session));
} else if ((msg->type == JSONRPC_ERROR
|| msg->type == JSONRPC_REPLY)
&& ovsdb_idl_txn_process_reply(idl, msg)) {