You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by guo jiwei <te...@apache.org> on 2022/05/09 12:12:49 UTC

Discuss about creating partitioned topic in V1

Hi, community:
   I found that in the admin API V1, it is possible to successfully create
a partitioned topic without a namespace.
However, in V1, when getting the partitioned topic list
(getPartitionedTopicList) and when creating a non-partitioned topic, the
existence of the namespace is checked.
In V2, we all need to check whether the namespace exists.
For consistency, I think creating a partitioned topic in V1 also needs to
check for the existence of the namespace.
So, I push out patch #14858 <https://github.com/apache/pulsar/pull/14858>.
If the patch is passed, the user's existing topics will not be affected,
the newly created partitioned topic will fail, and a namespace needs to be
created first.

Above, I hope you can give some other ideas.


Regards
Jiwei Guo (Tboy)

Re: Discuss about creating partitioned topic in V1

Posted by Matteo Merli <ma...@gmail.com>.
It's already deprecated. No one is encouraged to use v1 API except for
users for Pulsar 1.x that had topics created with the old namings.

What I'm proposing, instead of trying to fix the inconsistencies in
that API, is to disable v1 API by default and leave a configuration
option to turn it on in the clusters where it's needed, which will be
<1% of the currently deployed clusters.


--
Matteo Merli
<ma...@gmail.com>

On Mon, May 9, 2022 at 9:49 PM Rajan Dhabalia <rd...@apache.org> wrote:
>
> > Having said that, V1 admin API was in effect considered as "soft
> deprecated" since Pulsar 2.0. All documentation has been focused on v2 APIs.
>
> There are Orgs which have large scale Pulsar clusters and use V1 apis.
> There is no way we can deprecate V1 api and it has to be maintained until
> we find a way to migrate V1 topics to V2. Right now, topics with V1 and V2
> api names are having a separate state and it's not easy to migrate existing
> V1 topics to V2 topics. So, any efforts which will cause incompatibility is
> not acceptable and we can not deprecate V1.
>
> Thanks,
> Rajan
>
> On Mon, May 9, 2022 at 4:37 PM Matteo Merli <ma...@gmail.com> wrote:
>
> > Why I agree that it "looks like a bug", "walks like a bug" and "talks
> > like a bug"...
> > this was actually a "feature" :)
> >
> > not a good one, or with a good reason to exist, but something we've
> > been trying not to break. I'm not going to dig into the "wrong"
> > reasoning on why this was done in the first place, unless someone is
> > really curious. :D
> >
> > Having said that, V1 admin API was in effect considered as "soft
> > deprecated" since Pulsar 2.0. All documentation has been focused on v2
> > APIs.
> >
> > I believe a better approach now would be to disable v1 APIs using the
> > configuration, and actually disabling it by default in next Pulsar
> > versions.
> >
> > Matteo
> >
> > Instead
> > --
> > Matteo Merli
> > <ma...@gmail.com>
> >
> > On Mon, May 9, 2022 at 12:06 PM Enrico Olivelli <eo...@gmail.com>
> > wrote:
> > >
> > > +1
> > > I agree totally. It is a bug
> > >
> > > Enrico
> > >
> > > Il Lun 9 Mag 2022, 20:59 Michael Marshall <mm...@apache.org> ha
> > scritto:
> > >
> > > > Great find, Jiwei Guo. I agree that this should be classified as a bug
> > > > and that we should change the V1 implementation so that a topic can
> > > > only be created if its namespace already exists.
> > > >
> > > > Thanks,
> > > > Michael
> > > >
> > > > On Mon, May 9, 2022 at 7:13 AM guo jiwei <te...@apache.org> wrote:
> > > > >
> > > > > Hi, community:
> > > > >    I found that in the admin API V1, it is possible to successfully
> > > > create
> > > > > a partitioned topic without a namespace.
> > > > > However, in V1, when getting the partitioned topic list
> > > > > (getPartitionedTopicList) and when creating a non-partitioned topic,
> > the
> > > > > existence of the namespace is checked.
> > > > > In V2, we all need to check whether the namespace exists.
> > > > > For consistency, I think creating a partitioned topic in V1 also
> > needs to
> > > > > check for the existence of the namespace.
> > > > > So, I push out patch #14858 <
> > https://github.com/apache/pulsar/pull/14858
> > > > >.
> > > > > If the patch is passed, the user's existing topics will not be
> > affected,
> > > > > the newly created partitioned topic will fail, and a namespace needs
> > to
> > > > be
> > > > > created first.
> > > > >
> > > > > Above, I hope you can give some other ideas.
> > > > >
> > > > >
> > > > > Regards
> > > > > Jiwei Guo (Tboy)
> > > >
> >

Re: Discuss about creating partitioned topic in V1

Posted by Rajan Dhabalia <rd...@apache.org>.
> Having said that, V1 admin API was in effect considered as "soft
deprecated" since Pulsar 2.0. All documentation has been focused on v2 APIs.

There are Orgs which have large scale Pulsar clusters and use V1 apis.
There is no way we can deprecate V1 api and it has to be maintained until
we find a way to migrate V1 topics to V2. Right now, topics with V1 and V2
api names are having a separate state and it's not easy to migrate existing
V1 topics to V2 topics. So, any efforts which will cause incompatibility is
not acceptable and we can not deprecate V1.

Thanks,
Rajan

On Mon, May 9, 2022 at 4:37 PM Matteo Merli <ma...@gmail.com> wrote:

> Why I agree that it "looks like a bug", "walks like a bug" and "talks
> like a bug"...
> this was actually a "feature" :)
>
> not a good one, or with a good reason to exist, but something we've
> been trying not to break. I'm not going to dig into the "wrong"
> reasoning on why this was done in the first place, unless someone is
> really curious. :D
>
> Having said that, V1 admin API was in effect considered as "soft
> deprecated" since Pulsar 2.0. All documentation has been focused on v2
> APIs.
>
> I believe a better approach now would be to disable v1 APIs using the
> configuration, and actually disabling it by default in next Pulsar
> versions.
>
> Matteo
>
> Instead
> --
> Matteo Merli
> <ma...@gmail.com>
>
> On Mon, May 9, 2022 at 12:06 PM Enrico Olivelli <eo...@gmail.com>
> wrote:
> >
> > +1
> > I agree totally. It is a bug
> >
> > Enrico
> >
> > Il Lun 9 Mag 2022, 20:59 Michael Marshall <mm...@apache.org> ha
> scritto:
> >
> > > Great find, Jiwei Guo. I agree that this should be classified as a bug
> > > and that we should change the V1 implementation so that a topic can
> > > only be created if its namespace already exists.
> > >
> > > Thanks,
> > > Michael
> > >
> > > On Mon, May 9, 2022 at 7:13 AM guo jiwei <te...@apache.org> wrote:
> > > >
> > > > Hi, community:
> > > >    I found that in the admin API V1, it is possible to successfully
> > > create
> > > > a partitioned topic without a namespace.
> > > > However, in V1, when getting the partitioned topic list
> > > > (getPartitionedTopicList) and when creating a non-partitioned topic,
> the
> > > > existence of the namespace is checked.
> > > > In V2, we all need to check whether the namespace exists.
> > > > For consistency, I think creating a partitioned topic in V1 also
> needs to
> > > > check for the existence of the namespace.
> > > > So, I push out patch #14858 <
> https://github.com/apache/pulsar/pull/14858
> > > >.
> > > > If the patch is passed, the user's existing topics will not be
> affected,
> > > > the newly created partitioned topic will fail, and a namespace needs
> to
> > > be
> > > > created first.
> > > >
> > > > Above, I hope you can give some other ideas.
> > > >
> > > >
> > > > Regards
> > > > Jiwei Guo (Tboy)
> > >
>

Re: Discuss about creating partitioned topic in V1

Posted by guo jiwei <te...@apache.org>.
Thanks.
@Matteo I will track this.

Regards
Jiwei Guo (Tboy)


On Tue, May 10, 2022 at 7:37 AM Matteo Merli <ma...@gmail.com> wrote:

> Why I agree that it "looks like a bug", "walks like a bug" and "talks
> like a bug"...
> this was actually a "feature" :)
>
> not a good one, or with a good reason to exist, but something we've
> been trying not to break. I'm not going to dig into the "wrong"
> reasoning on why this was done in the first place, unless someone is
> really curious. :D
>
> Having said that, V1 admin API was in effect considered as "soft
> deprecated" since Pulsar 2.0. All documentation has been focused on v2
> APIs.
>
> I believe a better approach now would be to disable v1 APIs using the
> configuration, and actually disabling it by default in next Pulsar
> versions.
>
> Matteo
>
> Instead
> --
> Matteo Merli
> <ma...@gmail.com>
>
> On Mon, May 9, 2022 at 12:06 PM Enrico Olivelli <eo...@gmail.com>
> wrote:
> >
> > +1
> > I agree totally. It is a bug
> >
> > Enrico
> >
> > Il Lun 9 Mag 2022, 20:59 Michael Marshall <mm...@apache.org> ha
> scritto:
> >
> > > Great find, Jiwei Guo. I agree that this should be classified as a bug
> > > and that we should change the V1 implementation so that a topic can
> > > only be created if its namespace already exists.
> > >
> > > Thanks,
> > > Michael
> > >
> > > On Mon, May 9, 2022 at 7:13 AM guo jiwei <te...@apache.org> wrote:
> > > >
> > > > Hi, community:
> > > >    I found that in the admin API V1, it is possible to successfully
> > > create
> > > > a partitioned topic without a namespace.
> > > > However, in V1, when getting the partitioned topic list
> > > > (getPartitionedTopicList) and when creating a non-partitioned topic,
> the
> > > > existence of the namespace is checked.
> > > > In V2, we all need to check whether the namespace exists.
> > > > For consistency, I think creating a partitioned topic in V1 also
> needs to
> > > > check for the existence of the namespace.
> > > > So, I push out patch #14858 <
> https://github.com/apache/pulsar/pull/14858
> > > >.
> > > > If the patch is passed, the user's existing topics will not be
> affected,
> > > > the newly created partitioned topic will fail, and a namespace needs
> to
> > > be
> > > > created first.
> > > >
> > > > Above, I hope you can give some other ideas.
> > > >
> > > >
> > > > Regards
> > > > Jiwei Guo (Tboy)
> > >
>

Re: Discuss about creating partitioned topic in V1

Posted by Matteo Merli <ma...@gmail.com>.
Why I agree that it "looks like a bug", "walks like a bug" and "talks
like a bug"...
this was actually a "feature" :)

not a good one, or with a good reason to exist, but something we've
been trying not to break. I'm not going to dig into the "wrong"
reasoning on why this was done in the first place, unless someone is
really curious. :D

Having said that, V1 admin API was in effect considered as "soft
deprecated" since Pulsar 2.0. All documentation has been focused on v2
APIs.

I believe a better approach now would be to disable v1 APIs using the
configuration, and actually disabling it by default in next Pulsar
versions.

Matteo

Instead
--
Matteo Merli
<ma...@gmail.com>

On Mon, May 9, 2022 at 12:06 PM Enrico Olivelli <eo...@gmail.com> wrote:
>
> +1
> I agree totally. It is a bug
>
> Enrico
>
> Il Lun 9 Mag 2022, 20:59 Michael Marshall <mm...@apache.org> ha scritto:
>
> > Great find, Jiwei Guo. I agree that this should be classified as a bug
> > and that we should change the V1 implementation so that a topic can
> > only be created if its namespace already exists.
> >
> > Thanks,
> > Michael
> >
> > On Mon, May 9, 2022 at 7:13 AM guo jiwei <te...@apache.org> wrote:
> > >
> > > Hi, community:
> > >    I found that in the admin API V1, it is possible to successfully
> > create
> > > a partitioned topic without a namespace.
> > > However, in V1, when getting the partitioned topic list
> > > (getPartitionedTopicList) and when creating a non-partitioned topic, the
> > > existence of the namespace is checked.
> > > In V2, we all need to check whether the namespace exists.
> > > For consistency, I think creating a partitioned topic in V1 also needs to
> > > check for the existence of the namespace.
> > > So, I push out patch #14858 <https://github.com/apache/pulsar/pull/14858
> > >.
> > > If the patch is passed, the user's existing topics will not be affected,
> > > the newly created partitioned topic will fail, and a namespace needs to
> > be
> > > created first.
> > >
> > > Above, I hope you can give some other ideas.
> > >
> > >
> > > Regards
> > > Jiwei Guo (Tboy)
> >

Re: Discuss about creating partitioned topic in V1

Posted by Enrico Olivelli <eo...@gmail.com>.
+1
I agree totally. It is a bug

Enrico

Il Lun 9 Mag 2022, 20:59 Michael Marshall <mm...@apache.org> ha scritto:

> Great find, Jiwei Guo. I agree that this should be classified as a bug
> and that we should change the V1 implementation so that a topic can
> only be created if its namespace already exists.
>
> Thanks,
> Michael
>
> On Mon, May 9, 2022 at 7:13 AM guo jiwei <te...@apache.org> wrote:
> >
> > Hi, community:
> >    I found that in the admin API V1, it is possible to successfully
> create
> > a partitioned topic without a namespace.
> > However, in V1, when getting the partitioned topic list
> > (getPartitionedTopicList) and when creating a non-partitioned topic, the
> > existence of the namespace is checked.
> > In V2, we all need to check whether the namespace exists.
> > For consistency, I think creating a partitioned topic in V1 also needs to
> > check for the existence of the namespace.
> > So, I push out patch #14858 <https://github.com/apache/pulsar/pull/14858
> >.
> > If the patch is passed, the user's existing topics will not be affected,
> > the newly created partitioned topic will fail, and a namespace needs to
> be
> > created first.
> >
> > Above, I hope you can give some other ideas.
> >
> >
> > Regards
> > Jiwei Guo (Tboy)
>

Re: Discuss about creating partitioned topic in V1

Posted by Michael Marshall <mm...@apache.org>.
Great find, Jiwei Guo. I agree that this should be classified as a bug
and that we should change the V1 implementation so that a topic can
only be created if its namespace already exists.

Thanks,
Michael

On Mon, May 9, 2022 at 7:13 AM guo jiwei <te...@apache.org> wrote:
>
> Hi, community:
>    I found that in the admin API V1, it is possible to successfully create
> a partitioned topic without a namespace.
> However, in V1, when getting the partitioned topic list
> (getPartitionedTopicList) and when creating a non-partitioned topic, the
> existence of the namespace is checked.
> In V2, we all need to check whether the namespace exists.
> For consistency, I think creating a partitioned topic in V1 also needs to
> check for the existence of the namespace.
> So, I push out patch #14858 <https://github.com/apache/pulsar/pull/14858>.
> If the patch is passed, the user's existing topics will not be affected,
> the newly created partitioned topic will fail, and a namespace needs to be
> created first.
>
> Above, I hope you can give some other ideas.
>
>
> Regards
> Jiwei Guo (Tboy)