Skip to content

Conversation

@liangyepianzhou
Copy link
Contributor

@liangyepianzhou liangyepianzhou commented Mar 20, 2025

#23526

Motivation

Fix inconsistent compression threshold behavior across batching modes. For single message sending, compression is enabled when the message size is greater than or equal to the threshold, while for batch sending, compression occurs when the size is greater than the threshold.

Modifications

  1. Standardize the criteria for determining the threshold to enable compression.
  2. Optimize formatting.
  3. Enhance testing.

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:

## Motivation
Unify the data size check during compression.

Currently, there is inconsistency in the criteria for determining the threshold of messages with compression enabled:
For instance, with compressMinMsgBodySize set to 4kb:
- When batching is not enabled, compression is applied to messages that are equal to or greater than 4kb.
- When batching is enabled, compression is applied to messages that are greater than 4kb.

## Modifications
1. Standardize the criteria for determining the threshold to enable compression.
2. Optimize formatting.
3. Enhance testing.
@github-actions
Copy link

@liangyepianzhou 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 -->

@AuroraTwinkle
Copy link
Contributor

LGTM

@liangyepianzhou liangyepianzhou changed the title [fix][client] Unify the data size check during compression [fix][client] Fix inconsistent compression threshold behavior across batching modes Mar 25, 2025
@Technoboy- Technoboy- added this to the 4.1.0 milestone Mar 25, 2025
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@liangyepianzhou liangyepianzhou merged commit b42beef into apache:master Mar 25, 2025
54 of 58 checks passed
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
…batching modes (apache#24102)

Co-authored-by: xiangying <mengxiangying@xiaohongshu.com>
apache#23526
## Motivation
Fix inconsistent compression threshold behavior across batching modes. For single message sending, compression is enabled when the message size is greater than or equal to the threshold, while for batch sending, compression occurs when the size is greater than the threshold.

## Modifications
1. Standardize the criteria for determining the threshold to enable compression.
2. Optimize formatting.
3. Enhance testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants