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

[bug][fn] Prevent putstate uses empty values #22127

Merged
merged 9 commits into from
Feb 27, 2024

Conversation

freeznet
Copy link
Contributor

@freeznet freeznet commented Feb 26, 2024

Fixes #22126

Main Issue: #xyz

PIP: #xyz

Motivation

When submitting the putstate requests with other libs such as pulsar-admin-go, the FunctionState JSON string may contain the default value of string or int, so the functions worker may use an incorrect value when the user submits with bytesString. See apache/pulsar-client-go#1184 for more details.

Modifications

  • Fix the logic
  • Add more tests

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: freeznet#10

@freeznet freeznet self-assigned this Feb 26, 2024
@freeznet freeznet closed this Feb 26, 2024
@freeznet freeznet reopened this Feb 26, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 26, 2024
@Technoboy- Technoboy- added this to the 3.3.0 milestone Feb 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.57%. Comparing base (1b1cfb5) to head (ead47f6).
Report is 5 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #22127       +/-   ##
=============================================
+ Coverage     34.05%   73.57%   +39.51%     
- Complexity    12150    32637    +20487     
=============================================
  Files          1659     1877      +218     
  Lines        129418   139528    +10110     
  Branches      14173    15307     +1134     
=============================================
+ Hits          44079   102660    +58581     
+ Misses        79497    28899    -50598     
- Partials       5842     7969     +2127     
Flag Coverage Δ
inttests 24.58% <0.00%> (-0.17%) ⬇️
systests 24.24% <57.14%> (?)
unittests 72.86% <0.00%> (+40.99%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ulsar/functions/worker/rest/api/ComponentImpl.java 48.12% <57.14%> (+47.58%) ⬆️

... and 1522 files with indirect coverage changes

@Technoboy- Technoboy- merged commit 430f4ff into apache:master Feb 27, 2024
50 checks passed
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] FunctionState with empty stringValue will overwrite the byteValue
4 participants