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

[fix][fn] Prevent create state table from API calls for non-exists instances #22107

Conversation

freeznet
Copy link
Contributor

@freeznet freeznet commented Feb 23, 2024

Fixes #22108

Main Issue: #xyz

PIP: #xyz

Motivation

Before #21597, The implementation of getStateStore for BKStateStoreProviderImpl will be called once by JavaInstanceRunnable to create the stream table once the instance gets started. But after #21597, the getStateStore will be called via the putstate and getstate APIs without any check, this will cause the creation of a stream table for non-existent functions and connectors.

Modifications

  • add function instance check before getStateStore

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:

Copy link

@freeznet Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@freeznet freeznet self-assigned this Feb 23, 2024
@freeznet freeznet closed this Feb 23, 2024
@freeznet freeznet reopened this Feb 23, 2024
@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Feb 23, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2024

Codecov Report

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

Project coverage is 73.69%. Comparing base (5a614e9) to head (b885bba).
Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #22107       +/-   ##
=============================================
+ Coverage     37.02%   73.69%   +36.66%     
- Complexity    12201    32040    +19839     
=============================================
  Files          1734     1874      +140     
  Lines        132277   139362     +7085     
  Branches      14480    15281      +801     
=============================================
+ Hits          48974   102700    +53726     
+ Misses        76823    28768    -48055     
- Partials       6480     7894     +1414     
Flag Coverage Δ
inttests 24.67% <0.00%> (-0.13%) ⬇️
systests 24.40% <62.50%> (-0.03%) ⬇️
unittests 72.95% <0.00%> (+40.97%) ⬆️

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.39% <62.50%> (+26.20%) ⬆️

... and 1444 files with indirect coverage changes

@Technoboy- Technoboy- added this to the 3.3.0 milestone Feb 24, 2024
@Technoboy- Technoboy- merged commit 5c44e1b into apache:master Feb 25, 2024
106 of 113 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] State APIs calls create stream table for non-existed instances
4 participants