Skip to content

Fix corrupted TsFile IT file selection - #18346

Merged
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/corrupted-tsfile-it-file-selection
Jul 29, 2026
Merged

Fix corrupted TsFile IT file selection#18346
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/corrupted-tsfile-it-file-selection

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Problem

testNormalQueryWithCorruptedChunkDataOrPageReader searched the entire DataNode data/sequence tree for the first TsFile. If another database had already created a TsFile, the test could corrupt that unrelated file and then incorrectly report that the target query succeeded.

The test also only called Statement.execute, so an exception raised while fetching a later result block could be missed.

Changes

  • Restrict the TsFile lookup to the test database's sequence directory.
  • Execute the query with executeQuery and consume the full result set so delayed corruption errors are surfaced.

Verification

  • mvn spotless:apply -pl integration-test -P with-integration-tests
  • mvn test-compile -pl integration-test -P with-integration-tests -DskipTests
  • git diff --check

This PR has:

  • been self-reviewed.
  • modified an existing integration test to cover the intended code path deterministically.
Key changed/added classes
  • IoTDBQueryWithCorruptedTsFileIT

Limit the corrupted file lookup to the test database and consume the full query result so corruption detected during later fetches is surfaced.
@jt2594838
jt2594838 merged commit 410ab85 into apache:master Jul 29, 2026
41 of 42 checks passed
@Caideyipi
Caideyipi deleted the fix/corrupted-tsfile-it-file-selection branch July 29, 2026 08:37
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.

3 participants