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

Support WAL Compression #12476

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Support WAL Compression #12476

wants to merge 17 commits into from

Conversation

THUMarkLau
Copy link
Contributor

@THUMarkLau THUMarkLau commented May 7, 2024

The write-ahead logging consumes a significant amount of I/O resources during data writing, sometimes even 2-7 times the amount of TsFile I/O. Currently, the write-ahead logging in the system is uncompressed, this is a main reason for the large volume of WAL. Therefore, compressing the write-ahead logging can save I/O resources and enhance system performance. This PR primarily introduces support for compressing write-ahead logging, featuring the following characteristics:

  1. The basic unit for compression and decompression is a WAL Buffer, which may contain several WAL Entries, with a default size of 16MB. This design achieves a good compression ratio while minimizing modifications to upper-layer applications.

  2. To maintain compatibility with previous versions, we have replaced the original Magic String in the WAL file with a Version String to distinguish between different versions of WAL. If there are subsequent new versions of WAL, we can continue to add new Version Strings.

  3. Multiple compression methods are supported. Currently, the choice of compression method is not open to users, but theoretically, our design supports various compression methods, and we may open this option in the future.

Changes in system resource consumption and system performance caused by this feature will be supplemented in subsequent comments.

@THUMarkLau THUMarkLau force-pushed the wal-compress-formal-branch branch 2 times, most recently from 89b0f35 to 94152b2 Compare May 24, 2024 06:04
Copy link

codecov bot commented May 25, 2024

Codecov Report

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

Project coverage is 43.44%. Comparing base (aa2687c) to head (069795d).

Current head 069795d differs from pull request most recent head 4df9c11

Please upload reports for the commit 4df9c11 to get more accurate results.

Files Patch % Lines
...torageengine/dataregion/wal/io/WALInputStream.java 74.69% 41 Missing ⚠️
...eengine/dataregion/wal/utils/WALEntryPosition.java 50.00% 7 Missing ⚠️
...wal/allocation/AbstractNodeAllocationStrategy.java 0.00% 6 Missing ⚠️
.../db/storageengine/dataregion/wal/io/LogWriter.java 97.36% 1 Missing ⚠️
...b/storageengine/dataregion/wal/io/WALMetaData.java 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12476      +/-   ##
============================================
+ Coverage     43.37%   43.44%   +0.07%     
  Complexity       69       69              
============================================
  Files          3164     3165       +1     
  Lines        196704   196931     +227     
  Branches      23431    23459      +28     
============================================
+ Hits          85316    85557     +241     
+ Misses       111388   111374      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented May 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

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.

None yet

1 participant