Skip to content
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

[PIP-130] Apply redelivery backoff policy for ack timeout #13707

Conversation

liudezhi2098
Copy link
Contributor

@liudezhi2098 liudezhi2098 commented Jan 11, 2022

Master Issue: #13528

Motivation

This pull request is the specific implementation plan of PIP-130

Modifications

Apply the message redelivery policy for the ack timeout.
Alert NegativeAckBackoff interface to RedeliveryBackoff.
Expose AckTimeoutRedeliveryBackoff in ConsumerBulider.
Add unit test case.
Currently only the Java client is modified.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Need to update docs?

  • doc

@github-actions github-actions bot added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Jan 11, 2022
@codelipenghui codelipenghui added this to the 2.10.0 milestone Jan 11, 2022
@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

@liudezhi2098
Copy link
Contributor Author

@codelipenghui @hangc0276 @wolfstudy PTAL

@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Anonymitaet Anonymitaet added the doc-complete Your PR changes impact docs and the related docs have been already added. label Jan 18, 2022
@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

this.maxDelayMs = maxDelayMs;
this.multiplier = multiplier;
maxMultiplierPow = multiplier == 1 ? -1 :
(int) (Math.log((double) maxDelayMs / minDelayMs) / Math.log(multiplier)) + 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this "+ 1" here causing the final result overflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this parameter is to reduce invalid POW calculations.

super(client, consumerBase, conf);
this.ackTimeoutRedeliveryBackoff = conf.getAckTimeoutRedeliveryBackoff();
this.ackTimeoutMessages = new HashMap<MessageId, Long>();
this.redeliveryMessageIdPartitionMap = new ConcurrentHashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this redeliveryMessageIdPartitionMap need to be ConcurrentHashMap ?
It seems to be wrapped with writeLock

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove concurrent var.

@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

2 similar comments
@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

@liudezhi2098
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 74b5d50 into apache:master Jan 27, 2022
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
### Motivation

This pull request is the specific implementation plan of PIP-130

### Modifications

*Apply the message redelivery policy for the ack timeout.*
*Alert NegativeAckBackoff  interface to  RedeliveryBackoff.*
*Expose AckTimeoutRedeliveryBackoff in ConsumerBulider.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. doc-complete Your PR changes impact docs and the related docs have been already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants