- CPS-1812Getting issue details... STATUS
Requirements
Functional
# | Interface | Requirement | Additional Information | Sign-Off |
---|---|---|---|---|
1 | CPS-E-08.e | NCMP is to merge CM Notification Subscriptions Create request for the same CM Handle & XPath(s) |
| |
2 | CPS-E-08.e | Last lights out: upon subscription Delete request only when there is no more subscription for a cm-handle & xpath combination a subscription-delete request wil be send to the relevant DMI(s) | ||
3 | CPS-E-08.e | Amalgamation per DMI: all subscription updates originating from a single client request should be send to a single DMI in one request (message). Of course there can be several message if more than 1 DMI is involved. | The need for amalgamation / granularity of message might need to be discussed pending the required characteristics (issue #8). If a single subscriptions can contain all possible cm-handles with many cps-paths it then becomes feasible all CM-Handles refuse all paths or a specific path... Will all that info fit in a single response message. Is that the right thing to do?!!! | |
4 | CPS-NCMP-I-01 | CM Handle deletion should update subscription details | do NOT delete dmi-subscription entry until owning subscription is deleted, see issue #4 below | |
5 | CPS-E-08.e | backward compatible with 'basic' created/delete operations.. TBD | could use versioning in API–methods and schema's to handle this?! see also issue #12 |
Error Handling
Error Scenario | Expected behavior | Sign-off | |
---|---|---|---|
1 | DMI Down | rejected | |
2 | DMI Not responding withing 30 sec | pending | |
3 | create for non-existing cm handle id | rejected | |
4 | delete for non-existing cm handle id | (silently?) ignore | |
5 | any operation on non-existing xpath | ignore? (no or minimal validation, see issue #5) | |
6 | delete for non existing name/client-id | TBD, should be handle in 'basic' solution | |
7 | delete for no existing cm-handle id | ignore? (no or minimal validation, see issue #5) | |
8 | error upon error | An error scenario on a second subscription for the same cm-handle/xpath as a previous subscription which did not complete successfully (yet) to be discussed, see tabel below |
Characteristics
# | Parameter | Expectation | Notes | Sign-off |
---|---|---|---|---|
1 | Maximum number of cm data subscriptions | 200 | kieran mccarthy confirmed | |
2 | Maximum, Average CM Handles per subscription | Max: TBD Avg: 200 | kieran mccarthy to confirm | |
3 | Maximum, Average XPaths per CmHandle | Max: Avg: 10 | ||
4 | Status update processing time limit | Based on the numbers above working out the current state of each cm handle/xpath combination could be slow! | kieran mccarthy order of 30 seconds (NCMP side) |
Out-of-scope
- CM Notification Forwarding Check: When forwarding CM Notification NCMP will not check the content to see if the is a valid active subscription. It is assumed that the DMI Plugin as acted on the 'delete subscription' request (that request is NCMPs responsibility). And of course there wil be timing issues it also possible a CM Notification was send just after the subscription-delete was send (from client) but before the whole change had acted upon that.
- Retry: NCMP wil only report when actions are pending or rejected. NCMP will not implement a retry mechanism
- Wildcards: Wildcards or similar functionality where one string represent 0 or more xpaths is not covered as part of this requirement but it should be kept in mind as a future possibility
- Dynamic Topic: Topic for CM Data Notifications back to client will be hardcode for now.
Study shoudl consider compatibility with an 'ALL' cm handles options
Assumptions
# | Assumption | Notes |
---|---|---|
1 | Targets is a collection of xpaths | can be implemented as a json array of strings |
2 | for the DMI plugin cm-handle-id and xpath are the key to a unique subscription | the client-id and subscription name are not relevant for the DMI (should not be included in the request) as this would break the concept of merging! |
Issues & Decisions
Issue | Notes | Decision | |
---|---|---|---|
1 | Is it intended that CM Notification subscription request cover (all) descendants of the given xpath too?! | e.g.. if a child is removed and there is a subscription for the parent node, will a notification be send (grandchild, child leaf updates etc.) I hope NOT! Consider:
| kieran mccarthy descendant not covered by 'basic' paths Wildcard will cover this kind of function in future |
2 | Could xpath point to an element that does not exist (yet) | if not how, how can I client be informed about a create event? | kieran mccarthy yes, xpath can point to things that don't exist yet (not even in the curernt model when an upgraded is pending) |
3 | Should NCMP support re-homing, moving of a CM Handle from one DMI to another? | assume only trough delete & create | kieran mccarthy out of scope |
4 | CM Handle Delete: Should DMI or Clients be sent a subscription update | do NOT delete dmi-subscription entry until owning subscription is deleted Note. LCM is already broadcast (today) |
|
5 | Validation of xpath | options order of implement and also performance cost!
| kieran mccarthy not required right now |
6 | can DMI plugin 'reject' a subscription create (for a given cm-handle-xpath combination) | As NCMP might not validate as per issue#5 the DMI=plugin or component further down might have to reject an invalid xpath... | yes currently DMI can use response to say which cm handles are not accepted i.e. rejected' (but not 'pending') kieran mccarthyconfirms DMI can reject whole subscription |
7 | implementation question: should 'rejected' DMI-subscriptions be stored | not needed as whole subscription should be rejected | kieran mccarthyconfirms |
8 | Dimensioning of DB depends on #cm handles, #subscriptions and #xpaths per subscription, this could be too big for fast processing of updates! | Need to agree maximum and possibly realistic average/total number of entries based on the characteristics above The team is blocked until this becomes clear as it wil affect the way the data needs to be modelled exactly | ongoing but not completed! |
9 | Maximum (error) message size | theoretically all cm handles and all xpaths combinations could be rejected or pending leading to a very large error message! | Toine Siebelink no longer relevant given and max decided |
10 | can each CM-Handle have different set of xpath(s) per subscription | the current 'basic' solution only supports a common set of datastore/xpaths (filter) | kieran mccarthy Yes, clients will create only one subscription and they might have different needs for different nodes (cm handles) |
11 | can the same cm handle/xpath have different subscriptions with different datastores, does that affect the cm data notifications send (which datastore applies) |
| kieran mccarthy datastore included. Although this wiki-page will not be updated where cmHandle+xpath is mentioned as unique entry etc. this should now include a third field: datastore as well. |
12 | Will migration from 'basic' be supported | Preferred to ask customers to create new subscriptions | kieran mccarthy no need to support (migration) of 'basic' solution. Development of 'basic' solution can be stopped! |
13 | list v list instances filtering | /p/c1 | kieran mccarthy yes, from NCMP point of view a list and a list entry are different xpaths |
14 | confirm subscription id (currently subscription name + client id) | kieran mccarthy to clarify ASAP including exact format all prefer a single id-field | |
15 | what subscription details should be send when there is a change (in the union) |
| (after initial meeting) kieran mccarthy & Toine Siebelink agreed that because of the possible size of the union (200x200x10=400,000) it is only feasible to send the delta ie option 1. |
16 | one DMI rejects whole (see decision #6) subscription (affected cmhandles) but other DMI accepts the same subscription, is this possible how to handle | kieran mccarthy only sends message back to client about rejected DMIs i.e. the subscription can be partially 'active' |
Solution Proposals
Current state handling for 'basic' (not merged) subscription create/delete (under development)
Note. The above algorithm depends ons storing (in DB using yang modelled data) a cm-handle status for each cm-handle for each subscription!
Merge → Split
- NCMP treats a Client Subscription as one or more (small) DMI Subscriptions, each of which wil have there own state.
Each DMI Subscription is related to 1 or more client subscriptions.
If there is no more related client subscription the DMI Subscription can be deleted (once accepted by DMI Plugin)!
Data Model (not a great diagram...)
Create Combinations
Below examples demonstrate what should happen when two separate subscriptions operations are performed:
- an operation on subscription 'A' for client id '10
- an operation on subscription 'B' for client id '52'
# | Existing Subscription A-10 | Client Create Subscription B-52 Request | DMI Sub Create Request | Data Model Before (2nd) Create | Data Model After Create |
---|---|---|---|---|---|
1 | CH-1, [ /p/c1, /p/c2 ] | CH-1, [ /p/c1 ] | None | ||
2 | CH-1, [ /p/c1, p/c2 ] | CH-1, [ /p/c2, /p/c3 ] | CH-1, [ /p/c2, /p/c3 ] | ||
3 | CH-1, [ /p/c1] CH-2, [ /p/c1] | CH-2, [ /p/c1] CH-3, [ /p/c1] | CH-3, [ /p/c1] | ||
4 | CH-1, [ /p/c1] | CH-1, [ /p/c1/gc1 ] | CH-1, [ /p/c1/gc1 ] *as per decision 1 the xpath to a parent does NOT include any children... |
Create 'Merge' Diagram
Below diagram shows and example for two subscriptions with party overlapping CM Handles and XPaths.
* Note 1: given the possible combinations the message to DMI needs to be able to specify different xpaths per cm-handle. So a more complex structure is needed for this even ie. an array of CM Handles objects each having their own list of (target) xpaths!
Note 2: as per decision #11'datastore' should be included in all messages as well
Delete Combinations
# | Existing Subscription A-10 | Existing Subscription B-52 | Client Delete A-10 Request | DMI Sub update/delete request | Data Model* Before Before | Data Model* After Delete |
---|---|---|---|---|---|---|
1 | CH-1, [ /p/c1, p/c2 ] | CH-1, [ /p/c1 ] | CH-1, [ p/c2 ] | |||
2 | CH-1, [ /p/c1] CH-2, [ /p/c1] | CH-2, [ /p/c1] CH-3, [ /p/c1] | CH-1, [ /p/c1] | |||
3 | CH-1, [ /p/c1] | CH-1, [ /p/c1] CH-2, [ /p/c1] | None |
* Note: as per decision #11'datastore' should be included in the 'DMI susbcription' data model too now.
Error-Upon-Error Combinations
Previous Interaction | Current Interaction | Expectation | Notes | |
---|---|---|---|---|
1 | any operation on rejected for non-existing cm-handle | operation for same non-existing cm-handle | listed in 'rejected' immediately | behavior as normal |
2 | create operation rejected by DMI | create for same cm-handle/xpath | try again ?! | |
3 | create pending | create for same cm-handle/xpath | TBD send again or just remain pending?! | |
4 | create pending | delete for same cm-handle/xpath | ||
5 | delete pending | delete for same cm-handle/xpath | ||
6 | delete pending | create for same cm-handle/xpath | ||
7 |
Client-Schema Update
Based on Issue#10 , we need to change the incoming schema from DME to NCMP.
- A single subscription contains multiple predicates
- Predicates should be an array of Predicates ( currently a single instance )
- Each predicate contains an array of targets ( cmhandles) - as is.
- Each predicate contains a single datastore (mandatory)
- datastore-xpath-filter should become an array of xpath-filters (instead of pipe separated single string)
Performance considerations
Below options (partly) explored dring CPS teem meeting could explore further once we know the characteristics, see issue #8 !
- DMI record could reach in millions of instances
- In memory solution (ie hazelcast) can handle 10s - 100s of Megabytes (add some sample calc)
- still need persistence if we don't have enough instances
- use many small messages reduce need for amalgamation
- amalgamated string-based solution....
Solution Proposal - Storage
We have the below configuration managed by CPS-NCMP
# cmhandle dmi-plugin 1 ch-1 dmi-1 2 ch-2 dmi-1 3 ch-3 dmi-2
We get a Subscription Create Request with unique subscription-id and a list of predicates(list of targets , datastore and list of filters)
Subscription Create Request{ "subscriptionId" : "A-10", "predicates" : [ { "targets": [ch-1,ch-2], "datastore" : "ncmp-datastore:passthrough-operational", "datastore-xpath-filter" : ["p1/c1","p2/c2"] }, { "targets": [ch-3], "datastore" : "ncmp-datastore:passthrough-operational", "datastore-xpath-filter" : ["p3/c3"] } ] }
- We persist the incoming request as is in our persistent store using a relevant subscription model ( this model also needs to be revised )
We also maintain a distributed datastructure in Hazelcast to keep track of the request and response to the client.
SubscriptionId dmi-plugin affectedCmHandles status A-10 dmi-1 ["ch-1","ch-2"] PENDING A-10 dmi-2 ["ch-3"] PENDING - Read the requests from the distributed data structure and form the request for the DMI-Plugin and publish it to the internal kafka channel.
- If the DMI-Plugin responds back within the configured time , so the request will either be ACCEPTED or REJECTED.
- if whole subscription request is ACCEPTED , update the distributed data structure and then store the subscription to the ActiveSubscriptions in cps-cache.
- if whole subscription request is REJECTED , update the distributed data structure and send back the response to the client.
if the DMI Plugin fails to respond then the status would remain PENDING only as there is no change.
SubscriptionId dmi-plugin affectedCmHandles status A-10 dmi-1 ["ch-1","ch-2"] ACCEPTED A-10 dmi-2 ["ch-3"] REJECTED
We store the "ActiveSubscriptions" using a new model which will look like below.
SubscriptionId cmHandle filter A-10 ch-1 p1/c1 A-10 ch-1 p2/c2 A-10 ch-2 p1/c1 A-10 ch-2 p2/c2 Now based on whatever we have in the distributed map , we will send the response to the clients and may be clear the in-memory structure if required.
Proposed JIRAs
Priority | Component | Description | JIRA | Estimates |
---|---|---|---|---|
1 | ||||
2 | ||||
3 | ||||
4 | ||||
5 | ||||
6 | ||||
7 | ||||
8 |