Fix flex counter SAI errors during warm reboot by deferring until APPLY_VIEW#1784
Open
securely1g wants to merge 1 commit intosonic-net:masterfrom
Open
Fix flex counter SAI errors during warm reboot by deferring until APPLY_VIEW#1784securely1g wants to merge 1 commit intosonic-net:masterfrom
securely1g wants to merge 1 commit intosonic-net:masterfrom
Conversation
…LY_VIEW During warm reboot reconciliation, flex counter events may arrive before the VIDTORID mapping is fully populated. This results in counters being registered with RID 0x0, causing SAI calls to fail with SAI_STATUS_INVALID_PARAMETER every poll interval. Fix: Defer all flex counter events during warm boot reconciliation and process them after applyView() completes, when VIDTORID mapping is fully populated. - Add m_warmBootReconciling flag, initialized to true on warm start - Queue flex counter events in m_deferredFlexCounterEvents during reconciliation instead of processing them immediately - Drain the queue after applyView() succeeds and VIDTORID is updated - Flag is cleared after draining, so subsequent events process normally This approach ensures no flex counter is registered with an invalid RID, at the cost of no counter data during reconciliation (typically seconds to a few minutes). Signed-off-by: securely1g <securely1g@users.noreply.github.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Description
During warm reboot reconciliation, flex counter events may arrive before the VIDTORID mapping is fully populated. Counters get registered with RID 0x0, causing SAI calls to fail with SAI_STATUS_INVALID_PARAMETER (-5) every poll interval.
Fix (2 files changed)
Defer all flex counter events during warm boot and process them after
applyView()completes, when VIDTORID is fully populated.m_warmBootReconcilingflag and deferred event queuetrueon warm startapplyView()succeeds and VIDTORID is updatedHow it works
applyView()is the clear "reconciliation complete" signal — it runs the comparison logic, creates/removes SAI objects, and callssetVidAndRidMap()to repopulate the VIDTORID hash in Redis. After this point, all VID-to-RID translations will succeed.Trade-offs
Alternative
See companion PR #1783 for a skip-based approach that guards against null RID at collection time.
Signed-off-by: securely1g securely1g@users.noreply.github.com