Skip to content

Revert "Validate UTF-8 of DeltaLake delta-kernel-rs FFI option values" - #105963

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
Algunenano:revert-pr-105897
May 27, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
Algunenano:revert-pr-105897

Conversation

@Algunenano

@Algunenano Algunenano commented May 27, 2026 •

Copy link
Copy Markdown
Member

Reverts #105897 due to flakiness and memory leaks.

Closes #105961

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.6.1.199

…ix-104509-pr"

This reverts commit a07ca55, reversing
changes made to c15c432.
@antaljanosbenjamin antaljanosbenjamin self-assigned this May 27, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3ab7b26]


AI Review

Summary

This PR fully reverts the UTF-8 validation that had been added before calling delta-kernel-rs builder options. The revert is mechanically consistent, but it reintroduces a high-impact safety regression at the FFI boundary: invalid credential bytes can again trigger a panic crossing extern "C" and terminate the process.

Findings

❌ Blockers

  • [src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelHelper.cpp:74] Replacing setBuilderOptionChecked with direct ffi::set_builder_option removes input validation on user-provided option values. For non-UTF8 credentials (for example binary SAS material), the Rust side decodes as UTF-8 and can panic, which crosses FFI and aborts instead of returning a normal BAD_ARGUMENTS exception. Keep a guard at this call boundary (or make FFI return an error for invalid UTF-8) before merge.
Tests
  • ⚠️ Re-add a focused regression that proves malformed option bytes are rejected with BAD_ARGUMENTS without process termination (the previous 04294_deltalake_azure_invalid_utf8_credentials coverage was removed by this revert).
Final Verdict

Status: ⚠️ Request changes
Minimum required actions:

  1. Restore non-panicking handling for non-UTF8 builder option values before ffi::set_builder_option.
  2. Restore a regression test that fails if this FFI-boundary safety behavior regresses again.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 27, 2026
@Algunenano
Algunenano enabled auto-merge May 27, 2026 15:15
auto set_option = [&](const std::string & name, const std::string & value)
{
setBuilderOptionChecked(builder, name, value);
ffi::set_builder_option(builder, KernelUtils::toDeltaString(name), KernelUtils::toDeltaString(value));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the setBuilderOptionChecked guard here reintroduces a server-abort path on invalid option bytes.

ffi::set_builder_option receives raw KernelStringSlice and the Rust side decodes it as UTF-8. For non-UTF8 credentials (for example a binary SAS token like MD5('')), this crosses the extern "C" boundary via panic and terminates the process instead of returning BAD_ARGUMENTS.

Can we keep validation at this boundary (or make the FFI return an error) so malformed user input cannot kill the process?

@Algunenano
Algunenano added this pull request to the merge queue May 27, 2026
Merged via the queue into ClickHouse:master with commit 20435b5 May 27, 2026
40 of 65 checks passed
@Algunenano
Algunenano deleted the revert-pr-105897 branch May 27, 2026 15:54
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants