Skip to content

Backport #111803 to 26.6: Added a setting text_index_version for better forward compatibility - #115793

Merged
CurtizJ merged 3 commits into
26.6from
backport/26.6/111803
Aug 24, 2026
Merged

CurtizJ merged 3 commits into
26.6from
backport/26.6/111803

Conversation

@robot-ch-test-poll3

@robot-ch-test-poll3 robot-ch-test-poll3 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #111803
Cherry-pick pull-request #115612

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.6.4.18

@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backport Changes, backported to release branch. Do not use manually - automated use only! label Aug 21, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [8bdfa70]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6) ERROR

@CurtizJ

CurtizJ commented Aug 24, 2026

Copy link
Copy Markdown
Member

@groeneai fix build in this backport.

@groeneai

Copy link
Copy Markdown
Collaborator

@CurtizJ the build breaks on one line. DictionarySparseIndex::getToken does not exist on 26.6: it was added by 5513d53 ("Decompose tokens in sparse index of text index into chars and bit-packed offsets", 2026-07-05), which is not an ancestor of 26.6. Only the new gtest references it, so the src/ half of the backport is fine.

I have no push access to this repo, so here is the patch:

--- a/src/Storages/MergeTree/tests/gtest_posting_list_cursor.cpp
+++ b/src/Storages/MergeTree/tests/gtest_posting_list_cursor.cpp
@@ -3697,7 +3697,7 @@ TEST(PostingListCursorTest, TextIndexHeaderWriteInitialVersionOmitsCodec)
     EXPECT_EQ(sparse_index_data.version, MergeTreeTextIndexSerializationVersion::V0_Initial);
     EXPECT_EQ(sparse_index_data.codec_type, IPostingListCodec::Type::None);
     EXPECT_EQ(sparse_index_data.sparse_index.size(), 1u);
-    EXPECT_EQ(sparse_index_data.sparse_index.getToken(0), "gamma");
+    EXPECT_EQ(assert_cast<const ColumnString &>(*sparse_index_data.sparse_index.tokens).getDataAt(0), "gamma");
     EXPECT_EQ(sparse_index_data.sparse_index.getOffsetInFile(0), 13u);

This is behavior-preserving on this branch. On master getToken returns assert_cast<const ColumnString &>(**tokens_column).getDataAt(idx) for the ColumnPtr arm, and the bit-packed arm only exists with the commit above. On 26.6, deserializeHeader builds the tokens column through deserializeTokensRaw, which returns a ColumnString, so the ColumnPtr arm is the only reachable one. The same idiom is already used twice in this file, for alpha and beta, and both lines predate this backport.

Verification: I compiled the failing TU with the command from compile_commands.json (clang++-21, -Werror). Before the patch it fails with the exact CI error at 3700:46; after it, 0 errors and 0 warnings.

No second missing symbol is hiding behind the first error. All three failing builds report exactly one error: and one FAILED: target, and the ninja run kept going past it to [16660/16696], so the other six touched src/ files compiled.

@CurtizJ

CurtizJ commented Aug 24, 2026

Copy link
Copy Markdown
Member

@groeneai fix build in this backport.

DictionarySparseIndex::getToken does not exist on this branch. It was added
by 5513d53 ("Decompose tokens in sparse index
of text index into chars and bit-packed offsets"), which is not an ancestor of
26.6, so the new gtest from the backport does not compile here.

On master getToken returns assert_cast<const ColumnString &>(**tokens_column).getDataAt(idx)
for the ColumnPtr arm, and the bit-packed arm only exists with the commit above.
On this branch deserializeHeader builds the tokens column through
deserializeTokensRaw, which returns a ColumnString, so the ColumnPtr arm is the
only reachable one and reading through the tokens column is equivalent. The same
idiom is already used twice in this file, for "alpha" and "beta".
@groeneai

Copy link
Copy Markdown
Collaborator

@CurtizJ I cannot push to this branch (no push access to this repo, and maintainerCanModify is false on this PR), so I opened #116104 against backport/26.6/111803 with the fix. Merging it into this branch turns the build green.

It is the one-line change from my earlier comment: DictionarySparseIndex::getToken does not exist on 26.6, and only the new gtest references it.

@CurtizJ
CurtizJ merged commit 606b51c into 26.6 Aug 24, 2026
111 of 115 checks passed
@CurtizJ
CurtizJ deleted the backport/26.6/111803 branch August 24, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants