Mryange opened a new pull request, #71090:
URL: https://github.com/apache/doris/pull/71090

   ### Background
   
   A Doris table's compression setting normally determines the codec for its 
data pages. Each Segment records the codec in its column metadata, and the 
reader uses that metadata to select the decompressor. Single-block flushes 
already use the input block's size to skip compression for very small blocks. 
[Doris data 
compression](https://doris.apache.org/docs/dev/table-design/column-compression/)
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Enhancement
   
   Problem Summary:
   
   Operators experimenting with the trade-off between write CPU and storage 
space can select LZ4 for smaller writes to ZSTD tables. The policy applies to 
single-block flushes and is opt-in through a BE startup setting. BE fuzzy mode 
also chooses a codec per Segment to exercise mixed-codec reads in regression 
tests.
   
   ### Details
   
   - **Before and after:** Outside fuzzy mode, very small blocks still skip 
compression. For larger blocks on ZSTD tables, a positive threshold selects LZ4 
below the threshold and ZSTD at or above it. The threshold uses the in-memory 
input block size. Fuzzy mode samples one of seven supported options, including 
no compression, once per Segment on the single-block flush path.
   - **Configs and defaults:** Set `segment_lz4_threshold_kb` in the BE startup 
configuration. It defaults to zero, which disables the size policy. Existing 
regression pipelines already enable `enable_fuzzy_mode`.
   - **Impact on existing users:** With both settings at their defaults, writes 
follow the existing policy. Both the new policy and fuzzy mode use existing 
codec IDs in the column metadata and the existing reader.
   
   ### Testing
   
   - ASAN BE unit test 
`SegmentFlusherFormatTest.ReadSegmentsWithDifferentCompressionCodecs` passed on 
the development host. It verifies persisted codecs and reads back LZ4, ZSTD, 
uncompressed, and fuzz-selected Segments in V2 and V3.
   - ASAN BE unit test 
`SegmentFlusherFormatTest.WideKeyTableModelsKeepTheirSegmentBytes` passed on 
the development host and checks the existing byte-level output.
   - The test run predates a comment-only clang-tidy suppression in the new 
test.
   
   ### Release note
   
   A new opt-in BE startup setting can select LZ4 for smaller single-block 
writes to ZSTD tables.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: Yes (document the opt-in setting in the 
Doris BE configuration reference)
   - Pre-submission status: Partially verified: cluster regression, rolling 
upgrade tests, and performance measurements were not run.
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: Implementation, BE unit test, and PR description
   - Human review: not stated
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to