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

[refactor][function][PIP-166] Function add MANUAL delivery semantics #16279

Merged
merged 19 commits into from
Aug 1, 2022

Conversation

shibd
Copy link
Member

@shibd shibd commented Jun 29, 2022

Motivation

#15560

Modifications

  • This PR includes java, go, and python instance.
  • Mark autoAck will be deprecated.
  • Add MANUAL processing guarantees.
  • Add when autoAck == false and processingGuarantees == ATMOST_ONCE verification.
  • Refactor delivery semantics of windowsFunction, refer: PIP[Implementation][4]
  • Change user docs.
  • For go and python instance, add processingGuarantees not support EFFECTIVELY_ONCE validate.

Verifying this change

This change added tests and can be verified as follows:

  • FunctionConfigUtils cover autoAck == fase and ATMOST_ONCE scenarios.
  • SinkConfigUtils cover autoAck == fase and ATMOST_ONCE scenarios.
  • FunctionConfigUtils cover WindowsFunctionConfig will set processingGuarantees.
  • ContextImplTest and PulsarFunctionRecordTest cover when processingGuarantees != MANUAL, call record.ack() ignore.
  • JavaInstanceRunnableTest cover when function result == null, scenarios in which ack messages are required under various configurations.
  • WindowsFunctionExecutorTest cover windows function support processing guarantees scenarios.
  • Other unit tests have not changed, compatible with the current version implementation.

Documentation

  • doc
    (Your PR contains doc changes)

@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 Jun 29, 2022
@shibd shibd changed the title Implement java runtime instance [refactor][function][PIP-166] Function add MANUAL delivery semantics Jun 29, 2022
@shibd shibd force-pushed the pip-166 branch 2 times, most recently from 8e23f7e to 3f4dcbb Compare July 1, 2022 07:44
@shibd shibd marked this pull request as ready for review July 1, 2022 09:23
@shibd
Copy link
Member Author

shibd commented Jul 1, 2022

@asafm @nlu90 @freeznet @eolivelli @codelipenghui Please help to review this, I am coding on go and python function instances, and will open a new PR. Thank you

@shibd
Copy link
Member Author

shibd commented Jul 4, 2022

@asafm @nlu90 @freeznet @eolivelli @codelipenghui Please help to review this, I am coding on go and python function instances, and will open a new PR. Thank you

Modifications of the go and python instances have been submitted to this PR.

@shibd
Copy link
Member Author

shibd commented Jul 5, 2022

/pulsarbot run-failure-checks

@codelipenghui codelipenghui requested review from freeznet and nlu90 July 8, 2022 02:33
@codelipenghui codelipenghui added this to the 2.11.0 milestone Jul 8, 2022
@codelipenghui codelipenghui added type/feature The PR added a new feature or issue requested a new feature area/function labels Jul 8, 2022
Comment on lines +103 to +111
assert.Panics(t, func() {
newInstanceConfWithConf(&cfg.Conf{ProcessingGuarantees: 0, AutoACK: false})
}, "Should have a panic")
assert.Panics(t, func() {
newInstanceConfWithConf(&cfg.Conf{ProcessingGuarantees: 1, AutoACK: false})
}, "Should have a panic")
assert.Panics(t, func() {
newInstanceConfWithConf(&cfg.Conf{ProcessingGuarantees: 2})
}, "Should have a panic")
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 will introduce break change? If users upgrade to the new version but with the old configs.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's more like a bug fix, In go instance, it does not support exactly-once. It was not checked at startup before, which will cause the function to not ack any message. python instance has the same problem.

@shibd
Copy link
Member Author

shibd commented Jul 8, 2022

@nahguam Thanks for your review, all suggestions are fixed, please look again. Thanks.

@shibd shibd force-pushed the pip-166 branch 2 times, most recently from 8c75395 to 5d6ce24 Compare July 22, 2022 02:28
@codelipenghui codelipenghui modified the milestones: 2.11.0, 2.12.0 Jul 26, 2022
Copy link
Contributor

@freeznet freeznet left a comment

Choose a reason for hiding this comment

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

Nice work, @shibd, LGTM.

@shibd
Copy link
Member Author

shibd commented Jul 30, 2022

/pulsarbot run-failure-checks

@shibd
Copy link
Member Author

shibd commented Jul 31, 2022

/pulsarbot run-failure-checks

2 similar comments
@shibd
Copy link
Member Author

shibd commented Jul 31, 2022

/pulsarbot run-failure-checks

@shibd
Copy link
Member Author

shibd commented Jul 31, 2022

/pulsarbot run-failure-checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/function doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. type/feature The PR added a new feature or issue requested a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants