You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/03/26 04:26:36 UTC

[GitHub] [pulsar] DavidLiuXh opened a new issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

DavidLiuXh opened a new issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610
 
 
   **Describe the bug**
   The new consumer can't consume msg from new partition when dynamic extend parition
   
   **To Reproduce**
         1.  The pulsar cluster has three brokers;
         2.  Created partitioned topic whith three partition;
         3.  Run three consumers;
         4.  At this time, can see that each consumer consumes a parition;
         5.  Use 'pulsar-admin update-partitioned-topic' to dynamic extend partitions to four;
         6.  I can see that three consumer consumes four paritions;
         7.  Add a new consumer,but the new consumer can't consume msg from new 
             partition;  
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   **Screenshots**
   If applicable, add screenshots to help explain your problem.
   
   **Desktop (please complete the following information):**
    - OS: Centos 7
   **Additional context**
   - Pulasr 2.5.0
   - bookkeeper 4.10.0
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui edited a comment on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
codelipenghui edited a comment on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-611988851
 
 
   @315157973 Oh, thanks. I now know the reason. Maybe also can't sort by consumer ID, the consumer ID is generated by client-side and no increases monotonically guarantee. If only sorting consumers that have a priority level, can this solve the problem?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-611403572
 
 
   @DavidLiuXh I try to reproduce the problem follow the steps that you provided, but I can't reproduce it. I have added a unit test #6699 for consumer distribution when partitions update. Please help check if it is consistent with what you described. Thanks.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-614986948
 
 
   @315157973 Are you using the same consumer name? If you don't provide consumer name, the consumer name is generated by broker, so the case you described shouldn't happen.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-611988851
 
 
   @315157973 Oh, thanks. I will try to fix in #6699

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] 315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-611974320
 
 
   I also checked this problem before
   
   @ DavidLiuXh's description is not accurate. This should be:
   1 Create a Topic with 3 Partitions, and create 3 Consumers
   2 Update the number of Partitions to 4
   3 Add a new consumer
   4 We expect that each consumer consumes one Partition, the reality is that 3 consumers consume 4 Partitions. Occasional discovery
   
   the reason:
   In failover mode, the sorting of consumers is based on the name, and the sorting result of the name is not fixed, it should be sorted by consumer id instead.
   
   @codelipenghui 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-604250213
 
 
   What is the subscription type are you using?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-611282602
 
 
   @codelipenghui @jiazhai Can any of you help with this issue?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] DavidLiuXh commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
DavidLiuXh commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-604300336
 
 
   > What is the subscription type are you using?
   
   @sijie failover subscribe

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] 315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-615878828
 
 
   Both are right

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui removed a comment on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
codelipenghui removed a comment on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-611988851
 
 
   @315157973 Oh, thanks. I now know the reason. Maybe also can't sort by consumer ID, the consumer ID is generated by client-side and no increases monotonically guarantee. If only sorting consumers that have a priority level, can this solve the problem?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] 315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-615327304
 
 
   @sijie  The automatically generated names are numbers + letters, and the ones generated later may be ranked first. You can reproduce it with a unit test

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] 315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
315157973 commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-615856339
 
 
   Suppose there are 3 consumers, and their automatically generated names are: b1, b2, b4.
   
   The consumer lists of the 3 nodes are:
   
   node1: b1、b2、b4
   node2: b1、b2、b4
   node3: b1、b2、b4
   
   
   org.apache.pulsar.broker.service.AbstractDispatcherSingleActiveConsumer#pickAndScheduleActiveConsumer
   
   According to line 122
   
   index = partitionIndex % consumersSize;
   
   0 % 3 = 0
   1 % 3 = 1
   2 % 3 = 2
   
   Partition0 is consumed by b1
   Partition1 is consumed by b2
   Partition2 is consumed by b4
   
   When increased to 4 nodes, 4 consumers。The fourth consumer's name is b3
   
   The consumer lists of the 4 nodes are:
   node1: b1、b2、b3、b4
   node2: b1、b2、b3、b4
   node3: b1、b2、b3、b4
   node4: b3
   
   The consumption relationship becomes as follows:
   0 % 4 = 0
   1 % 4 = 1
   2 % 4 = 2
   3 % 1 = 0
   
   Partition0 is consumed by b1
   Partition1 is consumed by b2
   Partition2 is consumed by b3
   Partition3 is consumed by b3
   
   b4 is out of work
   
   Only after the client knows the Partition changes, b4 can enter the work。

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] codelipenghui commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-615867083
 
 
   So, after the client knows new partition added, b4 eventually takes over the new partition, right?  Are you using java client?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] 315157973 removed a comment on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition

Posted by GitBox <gi...@apache.org>.
315157973 removed a comment on issue #6610: The new consumer can't consume msg from new partition when dynamic extend parition
URL: https://github.com/apache/pulsar/issues/6610#issuecomment-615327304
 
 
   @sijie  The automatically generated names are numbers + letters, and the ones generated later may be ranked first. You can reproduce it with a unit test

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services