Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff api does generate deletes for leaf list values #933

Open
adelshafiei opened this issue Nov 17, 2023 · 6 comments
Open

Diff api does generate deletes for leaf list values #933

adelshafiei opened this issue Nov 17, 2023 · 6 comments

Comments

@adelshafiei
Copy link

I changed a leaf list value from [1, 18, 25] to [18, 25, 34]. Ygot diff api generate an update with value [18, 25, 34] and no delete. This results in the final list of [1, 18, 25, 34] which is not expected.

@wenovus
Copy link
Collaborator

wenovus commented Nov 17, 2023

Hi, ygot.Diff returns a Notification value. What did you do with the Notification value that caused the final list to occur?

@adelshafiei
Copy link
Author

I used the notification list to update device config. In the notification list, there is an update for [18, 25, 34] but no delete is generated for value 1 in the leaf list

@wenovus
Copy link
Collaborator

wenovus commented Nov 17, 2023

Did you use gNMI.Set with an Update message? If so, I believe setting a leaf-list should overwrite the value instead of appending to them.

That being said, taking a look at RFC7950, NETCONF insert seems to offer more flexible operations, while the gNMI spec doesn't explicitly talk about this scenario. @robshakir Do we have a stance on what happens with leaf-lists when gNMI.Set with Update is executed? Since we don't have an insert operation it seems like replacement must be our behaviour to keep things simple? Esp. if a non-leaf update is made containing leaf-list values. If so I'll update the spec to make this clearer.

@robshakir
Copy link
Contributor

Yes, we do not allow partial update of leaf-lists in gNMI -- we declaratively require them to be entirely specified.

@adelshafiei
Copy link
Author

In this case, can I enhance the ygot diff api to return a replace gnmipb.Update slice along side the gnmi notification to be used together for the gnmi set request?

@wenovus
Copy link
Collaborator

wenovus commented Nov 20, 2023

Not quite sure what enhancement you had in mind. Can you just call Set.Replace now instead of Set.Update? It seems like the device is not conforming to the right spec (I will make a PR to update the spec soon), and since Diff only returns leaves it seems like a safe thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants