Project

General

Profile

Feature #43324

Make zlib windowBits configurable for compression

Added by Xiyuan Wang 9 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Administration/Usability
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Reviewed:
Affected Versions:
Component(RADOS):
Pull request ID:

Description

Now the zlib windowBits is hardcoding as -151. But it should be set to different value for different case.

According to zlib guide2, windowBits can be set to [-15, -8) for raw deflate, (8, 15] for compression with header and trailer and [16,) for optional gzip encoding.

And now we meet an requirement to use 15 for zlib windowBits.

So for Ceph, is it possible to make `ZLIB_DEFAULT_WIN_SIZE` configurable to support different compression case?

[1]: https://github.com/ceph/ceph/blob/master/src/compressor/zlib/ZlibCompressor.cc#L43
[2]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/zlib.h#L552-L576

History

#1 Updated by Xiyuan Wang 9 months ago

Xiyuan Wang wrote:

Now the zlib windowBits is hardcoding as -151. But it should be set to different value for different case.

According to zlib guide2, windowBits can be set to [-15, -8) for raw deflate, (8, 15] for compression with header and trailer and [16,) for optional gzip encoding.

And now we meet an requirement to use 15 for zlib windowBits.

So for Ceph community, is it possible to make `ZLIB_DEFAULT_WIN_SIZE` configurable to support different compression case? If yes, I can contribute the code to upstream.

[1]: https://github.com/ceph/ceph/blob/master/src/compressor/zlib/ZlibCompressor.cc#L43
[2]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/zlib.h#L552-L576

#2 Updated by Igor Fedotov 5 months ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 34852

#3 Updated by Kefu Chai 4 months ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF