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

[client-common] Added safeguard for compressor #1307

Merged
merged 6 commits into from
Nov 15, 2024

Conversation

gaojieliu
Copy link
Contributor

Summary, imperative, start upper case, don't end with a period

Today, the compress/decompress can still be invoked even the compressor is closed already and for zstd based compressor, it would crash.
This PR add some safeguard and fail fast if the compressor is already closed.

How was this PR tested?

Will work on the unit test

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

Today, the `compress`/`decompress` can still be invoked
even the compressor is closed already and for zstd based
compressor, it would crash.
This PR add some safeguard and fail fast if the compressor
is already closed.
sixpluszero
sixpluszero previously approved these changes Nov 15, 2024
majisourav99
majisourav99 previously approved these changes Nov 15, 2024
Copy link
Contributor

@majisourav99 majisourav99 left a comment

Choose a reason for hiding this comment

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

Thanks Gaojie

Copy link
Contributor

@FelixGV FelixGV left a comment

Choose a reason for hiding this comment

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

Thanks!

@gaojieliu gaojieliu merged commit 06390c8 into linkedin:main Nov 15, 2024
52 checks passed
gaojieliu added a commit to gaojieliu/venice that referenced this pull request Nov 15, 2024
* [client-common] Added safeguard for compressor

Today, the `compress`/`decompress` can still be invoked
even the compressor is closed already and for zstd based
compressor, it would crash.
This PR add some safeguard and fail fast if the compressor
is already closed.

* Fixed integration test failures

* Minor tweak

* Added a unit test

* Fixed minor comment

* Skipped locking for NoopCompressor
@gaojieliu gaojieliu mentioned this pull request Nov 15, 2024
2 tasks
gaojieliu added a commit that referenced this pull request Nov 15, 2024
* [server] SN read quota versioned stats not initialized after restart (#1312)

The currentVersion and backupVersion of ServerReadQuotaUsageStats are not
set after server restart because handleStoreChanged is invoked for all
stores when the store repo undergoing refresh before we initialize and
register store change listener in ReadQuotaEnforcementHandler (part
of the ListenerService). As a result metrics that depend on current
and backup versions will not show up properly until store is updated.

The fix is to during initialization of ReadQuotaEnforcementHandler we
will invoke handleStoreChanged for all stores after we register store
change listener.

The bug is actually reproducible in existing integration test. However,
it was not caught because the test was broken/misconfigured...

* [client-common] Added safeguard for compressor (#1307)

* [client-common] Added safeguard for compressor

Today, the `compress`/`decompress` can still be invoked
even the compressor is closed already and for zstd based
compressor, it would crash.
This PR add some safeguard and fail fast if the compressor
is already closed.

* Fixed integration test failures

* Minor tweak

* Added a unit test

* Fixed minor comment

* Skipped locking for NoopCompressor

---------

Co-authored-by: Xun Yin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants