Skip to content

Conversation

@yixianOu
Copy link

@yixianOu yixianOu commented Dec 6, 2025

Description

This PR implements dependency protocol checking and deletion protection for stream routes, resolving #6939.

Previously, it was possible to create a subordinate stream route referencing a non-existent superior_id or a superior route with a mismatched protocol. Additionally, superior routes could be deleted even while being referenced by subordinate routes, leading to potential runtime errors.

Checklist

  • I have read the CONTRIBUTING guidelines.
  • I have added tests to cover my changes.
  • I have verified that the changes work as expected.

Changes

  1. Dependency Checking: Added validation in check_conf to ensure that when a superior_id is provided:
    • The referenced superior route exists.
    • The protocol of the subordinate route matches the superior route.
  2. Deletion Protection: Implemented a delete_checker to prevent the deletion of a stream route if it is currently referenced as a superior_id by other routes.
  3. Tests: Added a new test file t/admin/stream-routes-subordinate.t covering various scenarios including creation, protocol mismatch, and deletion protection.

Related Issue

Resolves #6939

Sign-off

Signed-off-by: Orician 2018783812@qq.com

…am routing

Signed-off-by: Orician <2018783812@qq.com>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Dec 6, 2025
@yixianOu yixianOu changed the title feat: Add dependency protocol checking and deletion checking for stre… feat: Add dependency protocol checking and deletion checking for stream routing Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: As a user, I want to check the subordinate relationship in the Admin API

1 participant