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

[FLINK-37463] make serialzer in ForStMapState Threadlocal #26286

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

mayuehappy
Copy link
Contributor

@mayuehappy mayuehappy commented Mar 12, 2025

What is the purpose of the change

Now, when using ForStMapState for asynchronous state reading and writing, userValueSerializer in ForStMapState will be used to serialize and deserialize the data. However, in asynchronous execution mode, multiple threads may use the same userValueSerializer instance for serialization and deserialization at the same time, which may cause some multi-thread conflicts in Serializer (eg: Kryo), so we need to make the userValueSerializer and userKeySerializer in ForStMapState ThreadLocal to avoid these problems.

Brief change log

make the userValueSerializer and userKeySerializer in ForStMapState ThreadLocal

Verifying this change

This change is a trivial rework

This change is already covered by existing tests

This change added tests and can be verified as follows:

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

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (yes )
  • The runtime per-record code paths (performance sensitive): (yes)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 12, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@fredia fredia left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, LGTM.

It seems that the failure of EventTimeWindowCheckpointingITCase is not related to this PR, as EventTimeWindowCheckpointingITCase is using ForStSyncKeyedStateBackend.

@fredia
Copy link
Contributor

fredia commented Mar 12, 2025

@flinkbot run azure

Copy link
Contributor

@RocMarshal RocMarshal left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, LGTM +1.

@mayuehappy
Copy link
Contributor Author

@flinkbot run azure

@mayuehappy
Copy link
Contributor Author

@fredia I see that the single test org.apache.flink.test.checkpointing.RescaleCheckpointManuallyITCase seems to have failed, which seems not related to my commit. It seems that the pod has exited directly. Where can I see the error?

@fredia
Copy link
Contributor

fredia commented Mar 17, 2025

@fredia I see that the single test org.apache.flink.test.checkpointing.RescaleCheckpointManuallyITCase seems to have failed, which seems not related to my commit. It seems that the pod has exited directly. Where can I see the error?

A coredump occurred while running RescaleCheckpointManuallyITCase, the coredump file may be here.

I reverted the integration of ForSt in RescaleCheckpointManuallyITCase, please help to rebase this PR.

@mayuehappy mayuehappy force-pushed the mapState-ser-threadlocal branch from 2d1ceb0 to 10bc584 Compare March 17, 2025 02:57
@mayuehappy
Copy link
Contributor Author

@flinkbot run azure

@mayuehappy
Copy link
Contributor Author

@fredia
Thanks for your information, I have rebased latest master branch. PTAL

@fredia
Copy link
Contributor

fredia commented Mar 18, 2025

@flinkbot run azure

1 similar comment
@mayuehappy
Copy link
Contributor Author

@flinkbot run azure

@fredia fredia merged commit 1c5a295 into apache:master Mar 19, 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.

5 participants