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

Handling transaction failures and reverting changes #48

Open
rsoarespadtec opened this issue May 26, 2023 · 0 comments
Open

Handling transaction failures and reverting changes #48

rsoarespadtec opened this issue May 26, 2023 · 0 comments

Comments

@rsoarespadtec
Copy link

Hi,
Looking at the plugin code I realized that there is a single subscription to the entire module (e.g., "/interface"), and changes are made to the network stack through libnl during the validation phase (event type being SR_EV_CHANGE). Additionally, since the plugin uses a single callback for the entire module, the SR_EV_ABORT event, as described in the sysrepo documentation, will not be generated specifically for this single callback:

"This event is also generated for RPC subscriptions when a later callback has failed and this one has already successfully processed SR_EV_RPC. The callback that failed will never get this event!"

https://netopeer.liberouter.org/doc/sysrepo/master/html/group__change__subs__api.html#gad007e862874bda7141c58ca72d8c1067

My concern is related to a scenario with a transaction that involves multiple modifications. In such cases, if one of these modifications fails (for example, due to an error returned by libnl), it can cause the callback handling the changes to fail as well. This raises a concern about how the system is reverted to its state before the commit, effectively undoing the modifications that were already processed. In my limited understanding of the code, if a failure occurs, the modifications are not properly undone and the system does not return to the state before the commit. Is this correct?

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

1 participant