asafm commented on code in PR #20507: URL: https://github.com/apache/pulsar/pull/20507#discussion_r1222983288
########## pip/pip-275.md: ########## @@ -1,59 +1,44 @@ -<!-- -RULES -* Never place a link to an external site like Google Doc. The proposal should be in this issue entirely. -* Use a spelling and grammar checker tools if available for you (there are plenty of free ones). - -PROPOSAL HEALTH CHECK -I can read the design document and understand the problem statement and what you plan to change *without* resorting to a couple of hours of code reading just to start having a high level understanding of the change. - -THIS COMMENTS -Please remove them when done. ---> - # Background knowledge - -<!-- -Describes all the knowledge you need to know in order to understand all the other sections in this PIP - -* Give a high level explanation on all concepts you will be using throughout this document. For example, if you want to talk about Persistent Subscriptions, explain briefly (1 paragraph) what this is. If you're going to talk about Transaction Buffer, explain briefly what this is. - If you're going to change something specific, then go into more detail about it and how it works. -* Provide links where possible if a person wants to dig deeper into the background information. - -DON'T -* Do not include links *instead* explanation. Do provide links for further explanation. - -EXAMPLES -* See [PIP-248](https://github.com/apache/pulsar/issues/19601), Background section to get an understanding on how you add the background knowledge needed. - (They also included the motivation there, but ignore it as we place that in Motivation section explicitly). ---> +As we can see from the doc[0] that `numWorkerThreadsForNonPersistentTopic` is a configuration to specify the number of worker threads to serve non-persistent topic. Review Comment: This is markdown - feel free to use its language to express links inline ########## pip/pip-275.md: ########## @@ -1,59 +1,44 @@ -<!-- -RULES -* Never place a link to an external site like Google Doc. The proposal should be in this issue entirely. -* Use a spelling and grammar checker tools if available for you (there are plenty of free ones). - -PROPOSAL HEALTH CHECK -I can read the design document and understand the problem statement and what you plan to change *without* resorting to a couple of hours of code reading just to start having a high level understanding of the change. - -THIS COMMENTS -Please remove them when done. ---> - # Background knowledge - -<!-- -Describes all the knowledge you need to know in order to understand all the other sections in this PIP - -* Give a high level explanation on all concepts you will be using throughout this document. For example, if you want to talk about Persistent Subscriptions, explain briefly (1 paragraph) what this is. If you're going to talk about Transaction Buffer, explain briefly what this is. - If you're going to change something specific, then go into more detail about it and how it works. -* Provide links where possible if a person wants to dig deeper into the background information. - -DON'T -* Do not include links *instead* explanation. Do provide links for further explanation. - -EXAMPLES -* See [PIP-248](https://github.com/apache/pulsar/issues/19601), Background section to get an understanding on how you add the background knowledge needed. - (They also included the motivation there, but ignore it as we place that in Motivation section explicitly). ---> +As we can see from the doc[0] that `numWorkerThreadsForNonPersistentTopic` is a configuration to specify the number of worker threads to serve non-persistent topic. +Actually, `numWorkerThreadsForNonPersistentTopic` will specify the thread number of `BrokerService#topicOrderedExecutor`. Initially it was meant only for non-persistent topics, +but now it is used for anything that needs to be done under strict order for a topic, like processing Subscriptions even for a persistent topic: +* There is only one place invoke `topicOrderedExecutor` for non-persistent topics.[1] +* Other places will invoke `topicOrderedExecutor` for persistent-topic or persistent-dispatcher. [2][3][4][5] # Motivation - -Introduce `numWorkerThreadsForPersistentTopic` to deprecate `numWorkerThreadsForNonPersistentTopic`. - -As we see from the following, the `numWorkerThreadsForNonPersistentTopic` is used to specify for PersistentTopic, not NonPersistentTopic. So I propose change the config item from `numWorkerThreadsForNonPersistentTopic` to `numWorkerThreadsForPersistentTopic`: - -<img width="1128" alt="image" src="https://github.com/apache/pulsar/assets/10233437/5c6ed147-e8c1-4c08-b3cf-6886e9b99c8f"> - ---> +Introduce `numWorkersTopicOrderedExecutor` to deprecate `numWorkerThreadsForNonPersistentTopic`. Because`numWorkersTopicOrderedExecutor` is a more accurate name ### Configuration - -Introduce `numWorkerThreadsForPersistentTopic` to deprecate `numWorkerThreadsForNonPersistentTopic` - -# Backward & Forward Compatibility -* Change `numWorkerThreadsForNonPersistentTopic` default values as `-1` -* Introduce new config `numWorkerThreadsForPersistentTopic` with default value `Runtime.getRuntime().availableProcessors()` -* All places invoke `getNumWorkerThreadsForNonPersistentTopic()` will be repleace by `getNumWorkerThreadsForPersistentTopic()` -* So if user doesn't set the `numWorkerThreadsForNonPersistentTopic`, the value of worker threads will keep `Runtime.getRuntime().availableProcessors()` -* If user set the `numWorkerThreadsForNonPersistentTopic` before, the value will keep what user set before. +* Introduce `numWorkersTopicOrderedExecutor`: Review Comment: ```suggestion * Introduce `topicOrderedExecutorThreadNum`: ``` ########## pip/pip-275.md: ########## @@ -1,59 +1,44 @@ -<!-- -RULES -* Never place a link to an external site like Google Doc. The proposal should be in this issue entirely. -* Use a spelling and grammar checker tools if available for you (there are plenty of free ones). - -PROPOSAL HEALTH CHECK -I can read the design document and understand the problem statement and what you plan to change *without* resorting to a couple of hours of code reading just to start having a high level understanding of the change. - -THIS COMMENTS -Please remove them when done. ---> - # Background knowledge - -<!-- -Describes all the knowledge you need to know in order to understand all the other sections in this PIP - -* Give a high level explanation on all concepts you will be using throughout this document. For example, if you want to talk about Persistent Subscriptions, explain briefly (1 paragraph) what this is. If you're going to talk about Transaction Buffer, explain briefly what this is. - If you're going to change something specific, then go into more detail about it and how it works. -* Provide links where possible if a person wants to dig deeper into the background information. - -DON'T -* Do not include links *instead* explanation. Do provide links for further explanation. - -EXAMPLES -* See [PIP-248](https://github.com/apache/pulsar/issues/19601), Background section to get an understanding on how you add the background knowledge needed. - (They also included the motivation there, but ignore it as we place that in Motivation section explicitly). ---> +As we can see from the doc[0] that `numWorkerThreadsForNonPersistentTopic` is a configuration to specify the number of worker threads to serve non-persistent topic. +Actually, `numWorkerThreadsForNonPersistentTopic` will specify the thread number of `BrokerService#topicOrderedExecutor`. Initially it was meant only for non-persistent topics, +but now it is used for anything that needs to be done under strict order for a topic, like processing Subscriptions even for a persistent topic: +* There is only one place invoke `topicOrderedExecutor` for non-persistent topics.[1] +* Other places will invoke `topicOrderedExecutor` for persistent-topic or persistent-dispatcher. [2][3][4][5] # Motivation - -Introduce `numWorkerThreadsForPersistentTopic` to deprecate `numWorkerThreadsForNonPersistentTopic`. - -As we see from the following, the `numWorkerThreadsForNonPersistentTopic` is used to specify for PersistentTopic, not NonPersistentTopic. So I propose change the config item from `numWorkerThreadsForNonPersistentTopic` to `numWorkerThreadsForPersistentTopic`: - -<img width="1128" alt="image" src="https://github.com/apache/pulsar/assets/10233437/5c6ed147-e8c1-4c08-b3cf-6886e9b99c8f"> - ---> +Introduce `numWorkersTopicOrderedExecutor` to deprecate `numWorkerThreadsForNonPersistentTopic`. Because`numWorkersTopicOrderedExecutor` is a more accurate name Review Comment: That's not the motivation. That's the actual design. The motivation is to make this config have a better name and increase the ability of users to understand what they are configuring. ########## pip/pip-275.md: ########## @@ -1,59 +1,44 @@ -<!-- -RULES -* Never place a link to an external site like Google Doc. The proposal should be in this issue entirely. -* Use a spelling and grammar checker tools if available for you (there are plenty of free ones). - -PROPOSAL HEALTH CHECK -I can read the design document and understand the problem statement and what you plan to change *without* resorting to a couple of hours of code reading just to start having a high level understanding of the change. - -THIS COMMENTS -Please remove them when done. ---> - # Background knowledge - -<!-- -Describes all the knowledge you need to know in order to understand all the other sections in this PIP - -* Give a high level explanation on all concepts you will be using throughout this document. For example, if you want to talk about Persistent Subscriptions, explain briefly (1 paragraph) what this is. If you're going to talk about Transaction Buffer, explain briefly what this is. - If you're going to change something specific, then go into more detail about it and how it works. -* Provide links where possible if a person wants to dig deeper into the background information. - -DON'T -* Do not include links *instead* explanation. Do provide links for further explanation. - -EXAMPLES -* See [PIP-248](https://github.com/apache/pulsar/issues/19601), Background section to get an understanding on how you add the background knowledge needed. - (They also included the motivation there, but ignore it as we place that in Motivation section explicitly). ---> +As we can see from the doc[0] that `numWorkerThreadsForNonPersistentTopic` is a configuration to specify the number of worker threads to serve non-persistent topic. +Actually, `numWorkerThreadsForNonPersistentTopic` will specify the thread number of `BrokerService#topicOrderedExecutor`. Initially it was meant only for non-persistent topics, +but now it is used for anything that needs to be done under strict order for a topic, like processing Subscriptions even for a persistent topic: +* There is only one place invoke `topicOrderedExecutor` for non-persistent topics.[1] +* Other places will invoke `topicOrderedExecutor` for persistent-topic or persistent-dispatcher. [2][3][4][5] # Motivation - -Introduce `numWorkerThreadsForPersistentTopic` to deprecate `numWorkerThreadsForNonPersistentTopic`. - -As we see from the following, the `numWorkerThreadsForNonPersistentTopic` is used to specify for PersistentTopic, not NonPersistentTopic. So I propose change the config item from `numWorkerThreadsForNonPersistentTopic` to `numWorkerThreadsForPersistentTopic`: - -<img width="1128" alt="image" src="https://github.com/apache/pulsar/assets/10233437/5c6ed147-e8c1-4c08-b3cf-6886e9b99c8f"> - ---> +Introduce `numWorkersTopicOrderedExecutor` to deprecate `numWorkerThreadsForNonPersistentTopic`. Because`numWorkersTopicOrderedExecutor` is a more accurate name ### Configuration - -Introduce `numWorkerThreadsForPersistentTopic` to deprecate `numWorkerThreadsForNonPersistentTopic` - -# Backward & Forward Compatibility -* Change `numWorkerThreadsForNonPersistentTopic` default values as `-1` -* Introduce new config `numWorkerThreadsForPersistentTopic` with default value `Runtime.getRuntime().availableProcessors()` -* All places invoke `getNumWorkerThreadsForNonPersistentTopic()` will be repleace by `getNumWorkerThreadsForPersistentTopic()` -* So if user doesn't set the `numWorkerThreadsForNonPersistentTopic`, the value of worker threads will keep `Runtime.getRuntime().availableProcessors()` -* If user set the `numWorkerThreadsForNonPersistentTopic` before, the value will keep what user set before. +* Introduce `numWorkersTopicOrderedExecutor`: Review Comment: I think it's a more appropriate name -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
