[NEUTRON-158] Dependency checking for Northbound API Created: 04/Apr/18 Updated: 24/Aug/18 |
|
| Status: | In Progress |
| Project: | neutron |
| Component/s: | northbound-api |
| Affects Version/s: | None |
| Fix Version/s: | Neon |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Michael Vorburger | Assignee: | Josh Hershberg |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | csit:3node | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Description |
|
The Neutron Northbound API currently (almost) always just returns an "OK" (HTTP 200) reply. Any errors that occur when the requested resource creation/update did not succeed, including missing dependency (but also other internal problems), is "lost" and not communicated to the caller (and only appears in the log). The technical explanation for this is ODL general architecture based on decoupled asynchronous listening on a shared data model, and the lack of any "feedback loop" between Neutron and e.g. Netvirt (or, in theory, other listeners to the Neutron model). The goal of this issue is to provide feedback to callers for a first set of missing dependencies. It will not include work to address the more general problem of error handling and feedback for other internal problems than some dependencies. Events that are originally ordered in the OpenStack Journal can get out of order because (a) the clustered driver reading from the DB could read out of order; (b) the driver sending to clustered load balanced ODL could cause events to be stored out of order in the ODL data store. This will throw off applications such as netvirt which do not expect this. In order to compensate for this, we will make the ODL Neutron project return an HTTP error other than 2xx range code if its dependencies are not, yet, available in the data store. For example, in the case of NEUTRON-149 a security rule which is written before a security group should be rejected. The validation happens, only, at the level of the Neutron model object data objects, not the internal netvirt or other models which eventually have created by the listeners in netvirt or other. The fact that e.g. a security rule requires a group with a certain ID (and all others like it), will be hard-coded in neutron. The initial implementation will focus on doing above for Create events. If at all and how to apply this to Update and Delete will be considered later under future issues with refined requirements. This work in ODL requires no changes to t the existing networking ODL driver code. Therefore we are not anticipating to make this a configurable optional feature via a switch, but just have this new behaviour active as the related changes will be merged. https://bugzilla.redhat.com/show_bug.cgi?id=1550699 |
| Comments |
| Comment by Michael Vorburger [ 28/May/18 ] |
|
We should pick a specific HTTP 4xx status code to return in case expected dependant objects are not (yet) present. Looking e.g. at the Wikipedia page about HTTP status codes, the following all seem vaguely appropriate:
I will start with 442, and will let anyone who thinks that there is a more appropriate one please comment here. |
| Comment by Josh Hershberg [ 29/May/18 ] |
|
Alternatively, we could just use 400 and give a textual explanation. Or we could try "402 Payment Required" and see if we could make a little money |
| Comment by Michael Vorburger [ 29/May/18 ] |
|
Removing |
| Comment by Michael Vorburger [ 20/Jun/18 ] |
|
> initial implementation will focus on doing above for Create events with the just merged c/72372, this is now on master. First round covers it for SG / SR; others should replicate this to other Neutron entities. > If at all and how to apply this to Update this is now proposed c/73248, but may need some disucssion... will the delta sent in a PUT to modify alway contain all fields? For example, does a PUT to modify an existing SR have to have that security_group_id field, like a POST to create must, or is that optional? Interested in your thoughts jhershbe, MikeKolesnik, thapar... > and Delete will be considered later under future issues with refined requirements. Delete probably does not need Dependency Checking - forget that. |
| Comment by Michael Vorburger [ 20/Jun/18 ] |
|
shague and I have agree to include this work under the umbrella of "work required for better clustering" (see label and Epic Link he just added), based on a private email exchange where thapar stated the following which jhershbe confirmed with "it makes sense to me to add it here as well." & "Yes, that is my thinking as well." in reply to:
|
| Comment by Michael Vorburger [ 25/Jun/18 ] |
|
> First round covers it for SG / SR; others should replicate this to other Neutron entities. the best way to organize this is probably with new sub-tasks for specific Neutron entities (TBC). |
| Comment by Michael Vorburger [ 25/Jul/18 ] |
|
> the best way to organize this is probably with new sub-tasks for specific Neutron entities (TBC) I would love someone else to take this over at this point. What's missing is basically just implementing more areAllDependenciesAvailable() methods, by replicating https://git.opendaylight.org/gerrit/#/c/72372/10/transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSecurityRuleInterface.java to all other Neutron entities. It's not particularly hard to do anymore (now that I've completing creating all the infrastructure that was required for this underneath), but I'm actually clueless about the Neutron entities... |
| Comment by Michael Vorburger [ 02/Aug/18 ] |
|
> take this over at this point |