perkolatte opened a new pull request, #71112: URL: https://github.com/apache/doris/pull/71112
### Background `information_schema.backend_tablets` lists the tablets on each BE, one row per tablet, built by the BE's `SchemaTabletsScanner`. A table's `compression` property, or the FE's `default_compression_type` when the property is absent, selects the codec that segment pages are written with; each tablet stores it as `TabletSchema::compression_type()`. The `COMPRESS_KIND` column shows a different, older tablet-schema field, `compress_kind`, which BEs always set to `COMPRESS_LZ4`. ### What problem does this PR solve? Issue Number: close #70500 Related PR: None PR Type: Enhancement Problem Summary: Users who check a tablet's compression in `backend_tablets` see `COMPRESS_LZ4` for every table, including tables created with `"compression" = "zstd"`, so the system table cannot show which codec a tablet uses. This PR adds a `COMPRESSION_TYPE` column, after the existing columns, with the tablet's page codec. `COMPRESS_KIND` keeps its value so that existing queries and tools see no change. | Table property | `COMPRESS_KIND` | `COMPRESSION_TYPE` (new) | |---|---|---| | `"compression" = "zstd"` | `COMPRESS_LZ4` | `ZSTD` | | `"compression" = "zlib"` | `COMPRESS_LZ4` | `ZLIB` | | `"compression" = "lz4"` | `COMPRESS_LZ4` | `LZ4` | | none (FE default `ZSTD`) | `COMPRESS_LZ4` | `ZSTD` | ### Details - **Before and after:** before, the table has 18 columns and none shows the page codec. After, it has 19; the new one holds the `segment_v2::CompressionTypePB` name (`ZSTD`, `LZ4F`, `ZLIB`, and so on) of the tablet's schema. It is the configured codec, not a measurement of each stored page: a page that does not compress well can still be stored uncompressed. - **Configs and defaults:** None. - **Impact on existing users:** the existing columns keep their positions and values. `SELECT *` from the table returns one more column. During a rolling upgrade done in the documented order (BEs first), an upgraded BE serves an old FE, which never asks for the new column. If an FE is upgraded before a BE, queries on that BE that read `COMPRESSION_TYPE`, including `SELECT *`, fail with `no match column for this column(COMPRESSION_TYPE)` until the BE is upgraded; other queries on the table work. ### Testing - Built FE and BE from this branch (`build.sh --fe --be`, release build in `apache/doris:build-env-ldb-toolchain-latest`) and ran them as a one-FE, one-BE local cluster. The four tables in the table above returned the values shown, and `information_schema.columns` lists `COMPRESSION_TYPE` at position 19, after `IS_OVERLAP`. - `backend_tablets.groovy` gains a check for a `zstd` and a `zlib` table. Its query, run by hand on that cluster, returns the rows in the updated `.out`; the suite itself was not run through the regression framework. - Not run in cloud mode. The scanner reads the same `TabletMeta` there, and the suite skips cloud mode, as before. ### Notes for Reviewers - `COMPRESS_KIND` is left alone, as the issue's analysis suggests: `compress_kind` and `compression_type` are separate fields with different enums, and other code may read `compress_kind`. ### Release note `information_schema.backend_tablets` has a new `COMPRESSION_TYPE` column that shows each tablet's page compression codec, such as `ZSTD`. `COMPRESS_KIND` is unchanged and still shows `COMPRESS_LZ4`. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes (the `backend_tablets` page in apache/doris-website needs the new column; a docs PR will follow) - Pre-submission status: Partially verified: the regression suite was not run through the framework, and cloud mode was not tested ### AI Disclosure - Tool: Claude Code (Claude Opus 5.5) - Generated: code, tests, this description - Human review: not stated - Prompts: The author asked for unclaimed Doris issues to work on, chose #70500, and asked for a full local BE build to verify it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
