S3Tables create DDL fix - #115652
Conversation
|
Workflow [PR], commit [dcf6898] Summary: ✅
AI ReviewSummaryThis PR tries to make Missing context / blind spots
Findings
Tests
Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 82/95 (86.32%) · Uncovered code |
| Poco::JSON::Object::Ptr request_body = new Poco::JSON::Object; | ||
| request_body->set("name", table_name); | ||
| request_body->set("location", metadata_content->getValue<String>("location")); | ||
| if (!managesTableLocation()) |
There was a problem hiding this comment.
S3TablesCatalog still goes through this shared request builder, and a few lines below we unconditionally add stage-create = false. AWS documents the S3 Tables REST endpoint as rejecting the stage-create option entirely, so omitting location here is not enough: CREATE TABLE can still fail with 400 Bad Request against the real service.
I think this needs an S3TablesCatalog::createTable override (or a managesTableLocation() branch) that suppresses stage-create altogether.
| /// that shares its storage view with the data (e.g. SeaweedFS) refuses to create | ||
| /// a namespace over the plain directory those files would leave behind. | ||
| catalog->createNamespaceIfNotExists(DataLake::parseTableName(table_id_.getTableName()).first, location_path); | ||
| catalog->createNamespaceIfNotExists(namespace_name, location_path); |
There was a problem hiding this comment.
This still calls the base REST namespace-create helper, which always POSTs properties.location. For S3 Tables that is not a supported namespace property, so the first CREATE TABLE in a fresh namespace is still likely to fail even after the table-location changes.
We probably need an S3-specific createNamespaceIfNotExists implementation, or a catalog capability that suppresses the location property for namespace creation as well.
| { | ||
| throw Exception(ErrorCodes::BAD_ARGUMENTS, "NoSuchBucket: {}", ex.what()); | ||
| DataLake::TableMetadata existing_table; | ||
| if (catalog->tryGetTableMetadata(namespace_name, table_name, existing_table)) |
There was a problem hiding this comment.
This existence probe does not make IF NOT EXISTS race-safe. Two concurrent creators can both observe "missing" here, one createTable succeeds, and the loser then bubbles the catalog conflict back as DATALAKE_DATABASE_ERROR instead of treating it as "already exists".
The non-managed path closes the same gap with If-None-Match on the metadata write. We need equivalent conflict handling here, e.g. surface HTTP_CONFLICT distinctly from createTable and swallow it when if_not_exists is set, or re-check existence after the conflict.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units112 translation units recompiled, 1041 s compile time in total, 112 of them have a recent master baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow to create own s3 tables
Workflow [PR]
Sync PR [sync-upstream/pr/115652]
Version info
26.8.1.1834(included in26.8and later)