You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by ZhengSong Tu <tz...@gmail.com> on 2021/05/24 12:44:15 UTC

[DISCUSS] Unbind the relationship in admin api

Hi folks,

Background

Now that the apisix admin api has a binding relationship. For example,
there is an upstream id in a route, and if you want to delete the upstream
pointed to by this upstream id, you have to delete the route first,
otherwise you will get an error like this "can not delete this upstream ……"

Related to this, apisix also has a problem where the admin api interface
updates the cache asynchronously (around 0.1s) for objects that have an
associated relationship.

This means that even if you delete the route and then delete the upstream
within the asynchronous cache update time period, you will still get "can
not delete this upstream ......"


Solution to discuss

We can provide an option like admin_api_object_bind (default is true).

When admin_api_object_bind is false , the bindings are not checked when
using the admin api, so that even if the upstream id in the route is bound
to the upstream, you can still delete the upstream without getting an error.

If admin_api_object_bind is true, the bindings will be checked as they are
now.

This will cause considerable changes to the CP side and DP side of apisix.
Would love to hear the community's thoughts on this.
also let me know if I am wrong. Looking forward to hearing from
you. Thanks.

Re: [DISCUSS] Unbind the relationship in admin api

Posted by YuanSheng Wang <me...@apache.org>.
the `admin_api_object_bind` should be a URI argument, it can be specified
by the API caller.



On Mon, May 24, 2021 at 9:56 PM ZhengSong Tu <tz...@gmail.com> wrote:

> yes, this looks more accurate
>
> Zexuan Luo <sp...@apache.org> 于2021年5月24日周一 下午9:09写道:
>
> > `admin_api_object_bind `  is confusing. We always bind the objects.
> > What about configuration_allow_missing_reference?
> >
> > ZhengSong Tu <tz...@gmail.com> 于2021年5月24日周一 下午8:44写道:
> > >
> > > Hi folks,
> > >
> > > Background
> > >
> > > Now that the apisix admin api has a binding relationship. For example,
> > > there is an upstream id in a route, and if you want to delete the
> > upstream
> > > pointed to by this upstream id, you have to delete the route first,
> > > otherwise you will get an error like this "can not delete this upstream
> > ……"
> > >
> > > Related to this, apisix also has a problem where the admin api
> interface
> > > updates the cache asynchronously (around 0.1s) for objects that have an
> > > associated relationship.
> > >
> > > This means that even if you delete the route and then delete the
> upstream
> > > within the asynchronous cache update time period, you will still get
> "can
> > > not delete this upstream ......"
> > >
> > >
> > > Solution to discuss
> > >
> > > We can provide an option like admin_api_object_bind (default is true).
> > >
> > > When admin_api_object_bind is false , the bindings are not checked when
> > > using the admin api, so that even if the upstream id in the route is
> > bound
> > > to the upstream, you can still delete the upstream without getting an
> > error.
> > >
> > > If admin_api_object_bind is true, the bindings will be checked as they
> > are
> > > now.
> > >
> > > This will cause considerable changes to the CP side and DP side of
> > apisix.
> > > Would love to hear the community's thoughts on this.
> > > also let me know if I am wrong. Looking forward to hearing from
> > > you. Thanks.
> >
>


-- 

*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/apisix

Re: [DISCUSS] Unbind the relationship in admin api

Posted by ZhengSong Tu <tz...@gmail.com>.
yes, this looks more accurate

Zexuan Luo <sp...@apache.org> 于2021年5月24日周一 下午9:09写道:

> `admin_api_object_bind `  is confusing. We always bind the objects.
> What about configuration_allow_missing_reference?
>
> ZhengSong Tu <tz...@gmail.com> 于2021年5月24日周一 下午8:44写道:
> >
> > Hi folks,
> >
> > Background
> >
> > Now that the apisix admin api has a binding relationship. For example,
> > there is an upstream id in a route, and if you want to delete the
> upstream
> > pointed to by this upstream id, you have to delete the route first,
> > otherwise you will get an error like this "can not delete this upstream
> ……"
> >
> > Related to this, apisix also has a problem where the admin api interface
> > updates the cache asynchronously (around 0.1s) for objects that have an
> > associated relationship.
> >
> > This means that even if you delete the route and then delete the upstream
> > within the asynchronous cache update time period, you will still get "can
> > not delete this upstream ......"
> >
> >
> > Solution to discuss
> >
> > We can provide an option like admin_api_object_bind (default is true).
> >
> > When admin_api_object_bind is false , the bindings are not checked when
> > using the admin api, so that even if the upstream id in the route is
> bound
> > to the upstream, you can still delete the upstream without getting an
> error.
> >
> > If admin_api_object_bind is true, the bindings will be checked as they
> are
> > now.
> >
> > This will cause considerable changes to the CP side and DP side of
> apisix.
> > Would love to hear the community's thoughts on this.
> > also let me know if I am wrong. Looking forward to hearing from
> > you. Thanks.
>

Re: [DISCUSS] Unbind the relationship in admin api

Posted by Zexuan Luo <sp...@apache.org>.
`admin_api_object_bind `  is confusing. We always bind the objects.
What about configuration_allow_missing_reference?

ZhengSong Tu <tz...@gmail.com> 于2021年5月24日周一 下午8:44写道:
>
> Hi folks,
>
> Background
>
> Now that the apisix admin api has a binding relationship. For example,
> there is an upstream id in a route, and if you want to delete the upstream
> pointed to by this upstream id, you have to delete the route first,
> otherwise you will get an error like this "can not delete this upstream ……"
>
> Related to this, apisix also has a problem where the admin api interface
> updates the cache asynchronously (around 0.1s) for objects that have an
> associated relationship.
>
> This means that even if you delete the route and then delete the upstream
> within the asynchronous cache update time period, you will still get "can
> not delete this upstream ......"
>
>
> Solution to discuss
>
> We can provide an option like admin_api_object_bind (default is true).
>
> When admin_api_object_bind is false , the bindings are not checked when
> using the admin api, so that even if the upstream id in the route is bound
> to the upstream, you can still delete the upstream without getting an error.
>
> If admin_api_object_bind is true, the bindings will be checked as they are
> now.
>
> This will cause considerable changes to the CP side and DP side of apisix.
> Would love to hear the community's thoughts on this.
> also let me know if I am wrong. Looking forward to hearing from
> you. Thanks.