Skip to content

[mirroring] Queue value 0 is missing after validation in config mirror-session command #10795

@arfeigin

Description

@arfeigin

Description

When adding new mirror session with queue value = 0, it is not entered to the config DB and won't show when printing the current mirror sessions.
The issue is found on master/202111/202012 branches, however it works correctly on 202106 branch.
I explored it a bit and the issue was introduced after PR #1825.

Steps to reproduce the issue:

Run the following commands:

  1. sudo config mirror_session erspan add ERSPAN2 100.0.0.1 100.0.0.2 0 11 35145 0 Ethernet0 rx
  2. show mirror_session

Describe the results you received:

Queue value is empty:
image

Describe the results you expected:

(202106 SONiC build)
image

Output of show version:

image

Additional information you deem important (e.g. issue happens only occasionally):

image
It looks like the issue can be solved by either omitting ‘type=QUEUE_RANGE’ but this way the queue value won't be validated, or keep the validation in place and change the condition check to: ‘if queue >= 0:’.
Both options solve the issue.

Metadata

Metadata

Assignees

Labels

MSFTTriagedthis issue has been triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions