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: the traffic-split plugin supports upstream_id #3512

Merged
merged 12 commits into from
Feb 25, 2021

Conversation

Firstsawyou
Copy link
Contributor

@Firstsawyou Firstsawyou commented Feb 4, 2021

What this PR does / why we need it:

close #3094

How to implement the health check and retry mechanism:

Use the upstream_id method in the plugin to refer to the defined upstream so that we can reuse the health detection and retry mechanism that the upstream already has.

Reasons for the init.lua file to adjust the execution order of plugins:

Since the upstream_id in the init.lua file is processed before the plugin is executed, it will cause the upstream_id setting in the traffic-split plugin to take effect. Therefore, this PR adjusts the logic code executed by the plug-in in the init.lua file before the processing of upstream_id.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@Firstsawyou Firstsawyou changed the title feat: the traffic-split plugin supports health check and retry mechanism feat: the traffic-split plugin supports upstream_id Feb 4, 2021
t/plugin/traffic-split.t Outdated Show resolved Hide resolved
@Firstsawyou Firstsawyou marked this pull request as ready for review February 6, 2021 10:42
@moonming
Copy link
Member

moonming commented Feb 6, 2021

What is the relationship between this pr and #3094? I didn't see it

@Firstsawyou
Copy link
Contributor Author

What is the relationship between this pr and #3094? I didn't see it

The feat of #3094 needs to be realized by supporting upstream_id in the plugin, and this pr is to solve the problem that the plugin supports upstream_id.

@moonming
Copy link
Member

moonming commented Feb 6, 2021

I still don't know why health check and retry mechanism are depends on upstream id?

@Firstsawyou
Copy link
Contributor Author

I still don't know why health check and retry mechanism are depends on upstream id?

Use the upstream_id method in the plugin to refer to the upstream that has been defined, so that we can reuse the health checks and retries that upstream already has, instead of repeatedly implementing them in the plugin.

doc/plugins/traffic-split.md Outdated Show resolved Hide resolved
apisix/init.lua Show resolved Hide resolved
apisix/plugins/traffic-split.lua Outdated Show resolved Hide resolved
apisix/plugins/traffic-split.lua Outdated Show resolved Hide resolved
apisix/plugins/traffic-split.lua Show resolved Hide resolved
@moonming
Copy link
Member

moonming commented Feb 7, 2021

I still don't know why health check and retry mechanism are depends on upstream id?

Use the upstream_id method in the plugin to refer to the upstream that has been defined, so that we can reuse the health checks and retries that upstream already has, instead of repeatedly implementing them in the plugin.

These should be explained in detail as much as possible in the issue and PR

apisix/plugins/traffic-split.lua Show resolved Hide resolved
apisix/init.lua Show resolved Hide resolved
doc/plugins/traffic-split.md Outdated Show resolved Hide resolved
doc/zh-cn/plugins/traffic-split.md Outdated Show resolved Hide resolved
t/plugin/traffic-split.t Outdated Show resolved Hide resolved
t/plugin/traffic-split.t Outdated Show resolved Hide resolved
t/plugin/traffic-split.t Outdated Show resolved Hide resolved
@spacewander spacewander merged commit 1d79ce5 into apache:master Feb 25, 2021
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.

feat: the traffic-split plugin supports health check and retry mechanism
5 participants