-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Kinesis]Fix kinesis sink can not retry to send messages #10420
Conversation
pulsar-io/kinesis/src/main/java/org/apache/pulsar/io/kinesis/KinesisSink.java
Outdated
Show resolved
Hide resolved
@dlg99 PTAL |
If I understood this approach correctly and to my best understanding of how the sink works, it will end up accumulating data in memory until the connection with kinesis is restored. If that takes too long, the PulsarSource will keep producing the data for the sink and eventually this will OOM. it needs a way (through the context?) to tell PulsarSource to pause. I suggest trying your test with "Send a million messages to the input topic of the kinesis sink connector." and monitoring jvm's memory |
@dlg99 @RobertIndie We can leverage the max unack message limitation to limit the memory of the connector when using |
@dlg99 Please help take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you handling this.
@eolivelli @codelipenghui I marked this issue for 2.7.2 |
Okay. Feel free to cherry pick. Otherwise I will do it tomorrow |
### Motivation Currently, when the kinesis sink connector fails to send a message, it will not retry. In this case, if `retainOrdering` is enabled, it will lead to subsequent messages can not be sent like the following: > 17:09:40.923 [crm/messaging-service/messaging-service-reply-0] WARN org.apache.pulsar.io.kinesis.KinesisSink - Skip acking message to retain ordering with previous failed message prod_extapi.reply.message-Optional[26380226003034] ### Modifications * Add retry logic for the kinesis sink connector. When sending a message fails, it will retry to send. (cherry picked from commit 345cd33)
Motivation
Currently, when the kinesis sink connector fails to send a message, it will not retry. In this case, if
retainOrdering
is enabled, it will lead to subsequent messages can not be sent like the following:Modifications
Verify
KinesisProducer
fails, it will go into theonFailure
method ofProducerSendCallback
and start retry.