Skip to content

Fix atomic rename with truncate for files which compression is inferred from their file extension#80979

Merged
alexey-milovidov merged 1 commit intomasterfrom
fix-atomic-rename-with-truncate
May 29, 2025
Merged

Fix atomic rename with truncate for files which compression is inferred from their file extension#80979
alexey-milovidov merged 1 commit intomasterfrom
fix-atomic-rename-with-truncate

Conversation

@pamarcos
Copy link
Copy Markdown
Member

This comment raised there was an error on the implementation.

ch "
SELECT number FROM numbers_mt(1000000) INTO OUTFILE 'numbers.txt.zst' TRUNCATE;
SELECT count() FROM file('numbers.txt.zst', 'LineAsString');
"

The problem is that it was taking the original name from the temp file name, which was built with a custom suffix. Due to this suffix, if the original file had any compression extension, ClickHouse didn't automatically detect and apply the one to use.
Interestingly, the stateless test did check that it was working with compression, but it was setting explicitly the compression to use.

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix atomic rename with truncate for files which compression is inferred from their file extension

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

It was taking the original name from the temp file name,
which was built with a custom suffix. Due to this suffix,
if the original file had any compression extension, ClickHouse
didn't automatically detect and apply the one to use.
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented May 28, 2025

Workflow [PR], commit [a4a8e3f]

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label May 28, 2025
@alexey-milovidov alexey-milovidov added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label May 28, 2025
@alexey-milovidov alexey-milovidov self-assigned this May 28, 2025
@alexey-milovidov alexey-milovidov added this pull request to the merge queue May 28, 2025
Merged via the queue into master with commit dabdffd May 29, 2025
120 checks passed
@alexey-milovidov alexey-milovidov deleted the fix-atomic-rename-with-truncate branch May 29, 2025 00:02
robot-ch-test-poll3 added a commit that referenced this pull request May 29, 2025
Cherry pick #80979 to 25.3: Fix atomic rename with truncate for files which compression is inferred from their file extension
robot-clickhouse added a commit that referenced this pull request May 29, 2025
…ich compression is inferred from their file extension
robot-ch-test-poll3 added a commit that referenced this pull request May 29, 2025
Cherry pick #80979 to 25.4: Fix atomic rename with truncate for files which compression is inferred from their file extension
robot-clickhouse added a commit that referenced this pull request May 29, 2025
…ich compression is inferred from their file extension
robot-ch-test-poll3 added a commit that referenced this pull request May 29, 2025
Cherry pick #80979 to 25.5: Fix atomic rename with truncate for files which compression is inferred from their file extension
robot-clickhouse added a commit that referenced this pull request May 29, 2025
…ich compression is inferred from their file extension
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 29, 2025
pamarcos added a commit that referenced this pull request May 29, 2025
Backport #80979 to 25.5: Fix atomic rename with truncate for files which compression is inferred from their file extension
pamarcos added a commit that referenced this pull request May 29, 2025
Backport #80979 to 25.4: Fix atomic rename with truncate for files which compression is inferred from their file extension
pamarcos added a commit that referenced this pull request May 29, 2025
Backport #80979 to 25.3: Fix atomic rename with truncate for files which compression is inferred from their file extension
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created-cloud deprecated label, NOOP label May 29, 2025
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label May 29, 2025
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud deprecated label, NOOP pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants