Skip to content

Conversation

@prabhataravind
Copy link
Contributor

  • In some cases where there are repeated link flaps, route_check.py flags local p2p IP prefixes as missing in APPL_DB. These /31 IPv4 or /126 IPv6 IPs are not expected to be present in APPL_DB after a link goes down. This change tries to filter out such entries.

    Failure results: {{
    "missed_ROUTE_TABLE_routes": [
    "10.10.196.16/31",
    "2603:10b0:31f:753::24/126"
    ]
    }}
    Failed. Look at reported mismatches above
    add: []
    del: [
    "10.10.196.16/31",
    "2603:10b0:31f:753::24/126"
    ]

What I did

How I did it

How to verify it

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 227374e to da49c12 Compare May 15, 2025 18:48
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from da49c12 to 44dcf95 Compare May 15, 2025 18:50
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 44dcf95 to c03c087 Compare May 15, 2025 23:33
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 70f909b to 5930d70 Compare July 3, 2025 02:23
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 5930d70 to 50e9636 Compare July 3, 2025 02:30
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 50e9636 to c605f09 Compare July 3, 2025 02:37
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from c605f09 to 3ab0820 Compare July 3, 2025 03:30
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from ac95347 to d71aa3d Compare July 3, 2025 21:03
@prabhataravind prabhataravind force-pushed the paravind/route_check branch from ef9d4bc to 84294b9 Compare July 7, 2025 03:20
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 84294b9 to 44d3417 Compare July 7, 2025 03:58
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 44d3417 to 016c07e Compare July 7, 2025 04:11
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

 * In some cases where there are repeated link flaps, route_check.py flags local
   p2p IP prefixes as missing in APPL_DB. These /31 IPv4 or /126 IPv6 IPs are
   not expected to be present in APPL_DB after a link goes down. This change
   tries to filter out such entries.

    Failure results: {{
        "missed_ROUTE_TABLE_routes": [
            "10.10.196.16/31",
            "2603:10b0:31f:753::24/126"
        ]
    }}
    Failed. Look at reported mismatches above
    add: []
    del: [
        "10.10.196.16/31",
        "2603:10b0:31f:753::24/126"
    ]

Signed-off-by: Prabhat Aravind <paravind@microsoft.com>
@prabhataravind prabhataravind force-pushed the paravind/route_check branch from 016c07e to 1b3425d Compare July 7, 2025 04:44
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prabhataravind prabhataravind requested a review from prsunny July 7, 2025 22:42
@prabhataravind prabhataravind marked this pull request as ready for review July 7, 2025 22:43
@prabhataravind prabhataravind requested a review from qiluo-msft July 8, 2025 03:21
@prsunny
Copy link
Contributor

prsunny commented Jul 14, 2025

@prabhataravind , changes lgtm. Since loopback is /32, i think we are good in covering loopback ip.

prsunny
prsunny previously approved these changes Jul 15, 2025
@qiluo-msft qiluo-msft requested a review from Copilot July 15, 2025 00:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates route_check.py to ignore local point-to-point IP prefixes (/31 IPv4 and /126 IPv6) when checking for missing routes, and adds a corresponding test case.

  • Introduce is_point_to_point_prefix, get_local_p2p_ips, and filter_out_local_p2p_ips helpers.
  • Apply filtering in check_routes_for_namespace before reporting missing APPL_DB routes.
  • Add test scenario (case 28) covering local P2P IP prefixes.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/route_check_test_data.py Add test case 28 for validating filtering of local p2p IPs.
scripts/route_check.py New helpers to detect and exclude /31 (IPv4) and /126 (IPv6) prefixes.
Comments suppressed due to low confidence (3)

scripts/route_check.py:450

  • The :return description is incorrect for is_point_to_point_prefix (it returns a boolean, not a list). Update the docstring to reflect that it returns True/False.
    :return sorted list of local p2p IP prefixes

scripts/route_check.py:485

  • [nitpick] Pretty-printing with indent=4 on every debug log may be expensive; consider logging a summary or caching get_local_p2p_ips results to reduce repeated DB lookups and JSON serialization.
    print_message(syslog.LOG_DEBUG, json.dumps({"APPL_DB_INTF": sorted(intf)}, indent=4))

tests/route_check_test_data.py:1321

  • The IPv6 prefix here starts with '9603:...' but elsewhere (and in descriptions) it uses '2603:...'. This mismatch may cause the test to not cover the intended prefix.
                        "PortChannel1021:9603:10b0:503:df4::5e/126": {},

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft merged commit 1c3f789 into sonic-net:master Jul 15, 2025
7 checks passed
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

Successfully merging this pull request may close these issues.

4 participants