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 2022/03/30 01:41:02 UTC
[GitHub] [pulsar] xuesongxs opened a new issue #14937: reconsumeLater can't receive message while restart all brokers
xuesongxs opened a new issue #14937:
URL: https://github.com/apache/pulsar/issues/14937
**Describe the bug**
Pulsar v2.8.1/v2.8.2
reconsumeLater can't receive message while restart all brokers.
Cluster:
1 broker
3 bookies
**To Reproduce**
Steps to reproduce the behavior:
1. create consumer:
```
public static void main(String[] args) throws Exception{
PulsarClient client = PulsarClient
.builder()
.serviceUrl("pulsar://127.0.0.1:6650")
.build();
ConsumerBuilder<NlMessage> consumerBuilder = client.newConsumer(Schema.JSON(NlMessage.class)).topic("batchtest")
.subscriptionName("batchTest")
.subscriptionType(SubscriptionType.Shared)
.enableRetry(true)
.enableBatchIndexAcknowledgment(true)
.receiverQueueSize(1000)
.negativeAckRedeliveryDelay(20, TimeUnit.SECONDS)
.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest);
// DLQ
DeadLetterPolicy deadLetterPolicy = DeadLetterPolicy.builder()
.deadLetterTopic("persistent://public/default/batchtest-dlq")
.retryLetterTopic("persistent://public/default/batchtest-retry")
.maxRedeliverCount(3)
.build();
consumerBuilder.deadLetterPolicy(deadLetterPolicy);
consumerBuilder.negativeAckRedeliveryDelay(10, TimeUnit.MICROSECONDS);
// 需要在死信策略设置以后 再设置ackTimeout (如果ackTimeout == 0)
consumerBuilder.ackTimeout(0, TimeUnit.SECONDS); // 如果receiverQueueSize或者deadLetterPolicy后,ackTimeout又变为30s。
Consumer<NlMessage> consumer = consumerBuilder.subscribe();
while (true) {
Message<NlMessage> message = consumer.receive();
System.out.println("message:" + message.getMessageId());
consumer.reconsumeLater(message, 1, TimeUnit.SECONDS);
}
}
```
2. create producer:
```
public static void main(String[] args) throws PulsarClientException {
PulsarClient pulsarClient = PulsarClient.builder().serviceUrl("pulsar://127.0.0.1:6650").build();
Producer<NlMessage> producer = pulsarClient.newProducer(Schema.JSON(NlMessage.class))
.topic("persistent://public/default/batchtest")
.blockIfQueueFull(true)
.sendTimeout(0, TimeUnit.SECONDS)
.create();
long i = 1;
while(i < 1000000L){
producer.sendAsync(new NlMessage());
i++;
}
}
```
3. start consumer
4. start producer
5. stop broker
6. start broker
7. See error
**Expected behavior**
Continue receiving messages.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
**Additional context**
Add any other context about the problem here.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084450735
> > > > Let me try
> > >
> > >
> > > Can you reproduce it?
> >
> >
> > How many broker have you started ?
>
> only 1
Hao many bookie count have you started ?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084441873
> Let me try
Can you reproduce it?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084449737
> > > Let me try
> >
> >
> > Can you reproduce it?
>
> How many broker have you started ?
only 1
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode edited a comment on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode edited a comment on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084537898
> > > > > > > > Let me try
> > > > > > >
> > > > > > >
> > > > > > > Can you reproduce it?
> > > > > >
> > > > > >
> > > > > > How many broker have you started ?
> > > > >
> > > > >
> > > > > only 1
> > > >
> > > >
> > > > Hao many bookie count have you started ?
> > >
> > >
> > > 3 bookies
> >
> >
> > I'll try to set up a same environment
>
> my wechat: daxia_xue
The problem was reproduced. But only if "topicName" is exactly the same as "subscriptionName", just like this:
```
client.newConsumer(Schema.JSON(NlMessage.class)).topic("same_as_topic_name").subscriptionName("same_as_topic_name")
```
The key operation:
- Before restart broker, do not stop consumer
- After broker restart, Unable to continue consuming messages
- It doesn't matter what the software version is
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode edited a comment on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode edited a comment on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084537898
> > > > > > > > Let me try
> > > > > > >
> > > > > > >
> > > > > > > Can you reproduce it?
> > > > > >
> > > > > >
> > > > > > How many broker have you started ?
> > > > >
> > > > >
> > > > > only 1
> > > >
> > > >
> > > > Hao many bookie count have you started ?
> > >
> > >
> > > 3 bookies
> >
> >
> > I'll try to set up a same environment
>
> my wechat: daxia_xue
The problem was reproduced . But only if "topicName" is exactly the same as "subscriptionName", just like this:
```
client.newConsumer(Schema.JSON(NlMessage.class)).topic("same_as_topic_name").subscriptionName("same_as_topic_name")
```
The key operation:
- Before restart broker, do not stop consumer
- After broker restart, Unable to continue consuming messages
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode edited a comment on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode edited a comment on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084537898
> > > > > > > > Let me try
> > > > > > >
> > > > > > >
> > > > > > > Can you reproduce it?
> > > > > >
> > > > > >
> > > > > > How many broker have you started ?
> > > > >
> > > > >
> > > > > only 1
> > > >
> > > >
> > > > Hao many bookie count have you started ?
> > >
> > >
> > > 3 bookies
> >
> >
> > I'll try to set up a same environment
>
> my wechat: daxia_xue
The problem was reproduced.
The key operation:
- Before restart broker, do not stop consumer
- The problem is : After broker restart, Unable to continue consuming messages
- It doesn't matter what the software version is
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode edited a comment on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode edited a comment on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084537898
> > > > > > > > Let me try
> > > > > > >
> > > > > > >
> > > > > > > Can you reproduce it?
> > > > > >
> > > > > >
> > > > > > How many broker have you started ?
> > > > >
> > > > >
> > > > > only 1
> > > >
> > > >
> > > > Hao many bookie count have you started ?
> > >
> > >
> > > 3 bookies
> >
> >
> > I'll try to set up a same environment
>
> my wechat: daxia_xue
The problem was reproduced. But only if "topicName" is exactly the same as "subscriptionName", just like this:
```
client.newConsumer(Schema.JSON(NlMessage.class)).topic("same_as_topic_name").subscriptionName("same_as_topic_name")
```
The key operation:
- Before restart broker, do not stop consumer
- After broker restart, Unable to continue consuming messages
- It doesn't matter what the software version is
- "topicName" is exactly the same as "subscriptionName"
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode edited a comment on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode edited a comment on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084537898
> > > > > > > > Let me try
> > > > > > >
> > > > > > >
> > > > > > > Can you reproduce it?
> > > > > >
> > > > > >
> > > > > > How many broker have you started ?
> > > > >
> > > > >
> > > > > only 1
> > > >
> > > >
> > > > Hao many bookie count have you started ?
> > >
> > >
> > > 3 bookies
> >
> >
> > I'll try to set up a same environment
>
> my wechat: daxia_xue
The problem was reproduced. But only if "topicName" is exactly the same as "subscriptionName", just like this:
```
client.newConsumer(Schema.JSON(NlMessage.class)).topic("same_as_topic_name").subscriptionName("same_as_topic_name")
```
The key operation:
- Before restart broker, do not stop consumer
- The problem is : After broker restart, Unable to continue consuming messages
- It doesn't matter what the software version is
- "topicName" is exactly the same as "subscriptionName"
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084537898
> > > > > > > > Let me try
> > > > > > >
> > > > > > >
> > > > > > > Can you reproduce it?
> > > > > >
> > > > > >
> > > > > > How many broker have you started ?
> > > > >
> > > > >
> > > > > only 1
> > > >
> > > >
> > > > Hao many bookie count have you started ?
> > >
> > >
> > > 3 bookies
> >
> >
> > I'll try to set up a same environment
>
> my wechat: daxia_xue
The problem was reproduced . But only if "topicName" is exactly the same as "subscriptionName", just like this:
```
client.newConsumer(Schema.JSON(NlMessage.class)).topic("same_as_topic_name").subscriptionName("same_as_topic_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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1083065210
Let me try
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084451396
> > > > > Let me try
> > > >
> > > >
> > > > Can you reproduce it?
> > >
> > >
> > > How many broker have you started ?
> >
> >
> > only 1
>
> Hao many bookie count have you started ?
3 bookies
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084445123
> > Let me try
>
> Can you reproduce it?
How many broker have you started ?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] poorbarcode commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084458560
> > > > > > Let me try
> > > > >
> > > > >
> > > > > Can you reproduce it?
> > > >
> > > >
> > > > How many broker have you started ?
> > >
> > >
> > > only 1
> >
> >
> > Hao many bookie count have you started ?
>
> 3 bookies
I'll try to set up a same environment
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on issue #14937: reconsumeLater can't receive message while restart all brokers
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on issue #14937:
URL: https://github.com/apache/pulsar/issues/14937#issuecomment-1084459777
> > > > > > > Let me try
> > > > > >
> > > > > >
> > > > > > Can you reproduce it?
> > > > >
> > > > >
> > > > > How many broker have you started ?
> > > >
> > > >
> > > > only 1
> > >
> > >
> > > Hao many bookie count have you started ?
> >
> >
> > 3 bookies
>
> I'll try to set up a same environment
my wechat: daxia_xue
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org