Repository navigation
Conversation
We added gnmi_test.go:1154-1204 directly in gnmi_test.go:
• Tested deleting interface[name=eth1]/subinterfaces/subinterface[index=0]/ipv4/addresses/address[ip=192.0.2.1].
• Verified that ygot.DiffWithAtomic with both PreferShadowPath=false and PreferShadowPath=true does emit deletes for all key leaves:
• /interfaces/interface[name=eth1]/name
• /interfaces/interface[name=eth1]/subinterfaces/subinterface[index=0]/index
• /interfaces/interface[name=eth1]/subinterfaces/subinterface[index=0]/ipv4/addresses/address[ip=192.0.2.1]/ip
Because ygot.DiffWithAtomic emits deletes for key leaves correctly, the intermittency (~3% of runs) came from concurrent execution
between:
• Config updates (s.configMu, preferShadowPath=true), and
• State reconciler updates (s.stateMu, preferShadowPath=false).
Because Server had two separate mutexes (configMu and stateMu), a state reconciler write and a config delete write could execute
concurrently. State updates running during or right after a delete could re-populate key leaves in the shared cache after the delete
notification was evaluated.
Fix Applied:
• Consolidated s.configMu and s.stateMu into a single s.mu in gnmi.go:64-67 in gnmi.go, ensuring synchronized and atomic mutations to the
shared datastore schemas and gNMI cache.
When deleting paths such as /interfaces/interface[name=eth1]/subinterfaces or non-existent paths, ytypes.UnmarshalSetRequest returned
InvalidArgument: no match found in .... Per gNMI specification Section 3.4.4, deleting a non-existent path is a no-op success.
Fix Applied:
• In gnmi.go:317-347, if ytypes.UnmarshalSetRequest fails with no match found, delete operations that don't match the tree are tolerated
as no-ops instead of failing with InvalidArgument.
In gnmi_test.go:1154-1289:
• TestInterfaceKeyLeavesDelete: Asserts that ygot.DiffWithAtomic emits Delete for all list key leaves (interface name, subinterface index,
address ip).
• TestDeleteOperations:
• delete_non-existent_path_returns_OK: Deleting a non-existent path returns OK (nil error).
• delete_intermediate_container_succeeds: Deleting intermediate container /interfaces/interface[name=eth1]/subinterfaces succeeds.
• configure_and_delete_cycles_leave_zero_residue_and_are_idempotent: 200 consecutive configure-then-delete cycles against the gNMI
server, verifying 0 residue leaves remain and repeated deletes are idempotent.
All unit tests in gnmi pass cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We added gnmi_test.go:1154-1204 directly in gnmi_test.go:
• Tested deleting interface[name=eth1]/subinterfaces/subinterface[index=0]/ipv4/addresses/address[ip=192.0.2.1]. • Verified that ygot.DiffWithAtomic with both PreferShadowPath=false and PreferShadowPath=true does emit deletes for all key leaves:
• /interfaces/interface[name=eth1]/name
• /interfaces/interface[name=eth1]/subinterfaces/subinterface[index=0]/index
• /interfaces/interface[name=eth1]/subinterfaces/subinterface[index=0]/ipv4/addresses/address[ip=192.0.2.1]/ip
Because ygot.DiffWithAtomic emits deletes for key leaves correctly, the intermittency (~3% of runs) came from concurrent execution between:
• Config updates (s.configMu, preferShadowPath=true), and • State reconciler updates (s.stateMu, preferShadowPath=false).
Because Server had two separate mutexes (configMu and stateMu), a state reconciler write and a config delete write could execute concurrently. State updates running during or right after a delete could re-populate key leaves in the shared cache after the delete notification was evaluated.
Fix Applied:
• Consolidated s.configMu and s.stateMu into a single s.mu in gnmi.go:64-67 in gnmi.go, ensuring synchronized and atomic mutations to the shared datastore schemas and gNMI cache.
When deleting paths such as /interfaces/interface[name=eth1]/subinterfaces or non-existent paths, ytypes.UnmarshalSetRequest returned InvalidArgument: no match found in .... Per gNMI specification Section 3.4.4, deleting a non-existent path is a no-op success.
Fix Applied:
• In gnmi.go:317-347, if ytypes.UnmarshalSetRequest fails with no match found, delete operations that don't match the tree are tolerated as no-ops instead of failing with InvalidArgument.
In gnmi_test.go:1154-1289:
• TestInterfaceKeyLeavesDelete: Asserts that ygot.DiffWithAtomic emits Delete for all list key leaves (interface name, subinterface index, address ip).
• TestDeleteOperations:
• delete_non-existent_path_returns_OK: Deleting a non-existent path returns OK (nil error).
• delete_intermediate_container_succeeds: Deleting intermediate container /interfaces/interface[name=eth1]/subinterfaces succeeds.
• configure_and_delete_cycles_leave_zero_residue_and_are_idempotent: 200 consecutive configure-then-delete cycles against the gNMI
server, verifying 0 residue leaves remain and repeated deletes are idempotent.
All unit tests in gnmi pass cleanly.