Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: increment route update for radixtree host uri, radixtree uri and radi… #9692

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

ranxuxin001
Copy link

This PR extends apisix to modify a route without create the whole radixtree everytime.

refer to #9334

@ranxuxin001 ranxuxin001 changed the title increment route update for radixtree host uri, radixtree uri and radi… feat: increment route update for radixtree host uri, radixtree uri and radi… Jun 19, 2023
apisix/http/router/radixtree_host_uri.lua Outdated Show resolved Hide resolved
apisix/http/router/radixtree_host_uri.lua Outdated Show resolved Hide resolved
apisix/http/router/radixtree_host_uri.lua Outdated Show resolved Hide resolved
if apisix_router.need_create_radixtree then
uri_router = base_router.create_radixtree_uri_router(routes, uri_routes, false)
apisix_router.need_create_radixtree = false
for k, _ in pairs(sync_tb) do
Copy link
Contributor

Choose a reason for hiding this comment

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

Use require("table.clear") instead?

if route and route.value then
local status = table.try_read_attr(route, "value", "status")
if status and status == 0 then
return
Copy link
Contributor

Choose a reason for hiding this comment

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

continue the loop? You could use goto statement.

end
end

sync_tb[k] = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

clear the whole table after the loop?

sync_tb[k] = nil
end

apisix_router.sync_tb = sync_tb
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to reassign the table? because they point to the same table.


_M.sync_tb = sync_tb
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this statement, and ditto.

local uri_routes = {}
local uri_router
local match_opts = {}
local function incremental_operate_radixtree(routes)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should put this function in radixtree_uri.lua or elsewhere and reuse it here, instead of redefine? They are the same except for the no_param_match.

if #routes == 0 then
host_routes[k] = nil
if op then
core.log.error("###################del####", k)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the debug logging.

Copy link

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

Copy link

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 22, 2024
@shreemaan-abhishek
Copy link
Contributor

ping @ranxuxin001

@github-actions github-actions bot removed the stale label Feb 6, 2024
@Revolyssup
Copy link
Contributor

ping @ranxuxin001

@nitishfy
Copy link

@ranxuxin001 are you available to work on this? We understand that you will be having other things to work for. In case you're not available to work on this, please mention it so that someone else can take this issue up!

Thank you again for contributing to apisix!

@TakiJoe
Copy link

TakiJoe commented May 8, 2024

@ranxuxin001 are you available to work on this? We understand that you will be having other things to work for. In case you're not available to work on this, please mention it so that someone else can take this issue up!

Thank you again for contributing to apisix!

hi @nitishfy , my colleague can no longer work on this issue. plz find someone else to handle it.

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.

None yet

7 participants