Repository navigation
Conversation
|
Workflow [PR], commit [ace7e12] Summary: ❌
AI ReviewSummaryThis PR enables Missing context
Findings❌ Blockers
ClickHouse Rules
Final Verdict
|
2684f3c to
7120440
Compare
7120440 to
231b3d1
Compare
231b3d1 to
d06894a
Compare
Since hard links creation is supported by plain_rewritable metadata, and implemented with copying object, make `supportsHardLinks()` to return true for plain_rewritable, and allow alter commands to be executed.
Not working yet due to different `disk` setting value in storage metadata (original definition with disk function) and storage_settings of MergeTreeData (replaced with the disk name), which leads to datatype conflict during alters. Marking this as unsupported with proper error message.
Object storage disks don't support root directory recursive removal, therefore final root directory cleanup for tables with table_disk is a no-op. Since mutation files are "known" objects that need to be cleaned up on table drop, they now are removed explicitly.
d06894a to
3950f03
Compare
| { | ||
| const auto disk = local_context->getDisk((*settings_from_storage)[MergeTreeSetting::disk]); | ||
| if (disk->isCustomDisk()) | ||
| throw Exception( |
There was a problem hiding this comment.
Was not working due to disk setting type differences between origial DDL (disk function) and disk settings of MergeTreeData (stores only a name) -- fixed by c1e3c6b (could be done simper by reusing getOrCreate disk, since any alter would fail later, but seemed more safe not to create new disks during ALTER operations)
58ef013 to
2b4fedb
Compare
c876178 to
a7efaef
Compare
|
Fixed azure tests as they now support alters, but flaky check may timeout because of running a bunch of unchanged tests (see #94641) UPD: not fixed yet, and it doesn't look related to running unchanged tests. |
a7efaef to
94fb3af
Compare
26e0614 to
56b5588
Compare
To make alters on tables with custom disks pass, the disk setting from Storage settings changes is normalized to only disk name. The logic is similar to what MergeTreeSettings::loadFromQuery does, except for prohibited creation of new custom disks.
56b5588 to
c1e3c6b
Compare
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
|
The test |
| if (auto disk_function_ast = getDiskFunctionAST(value)) | ||
| value = DiskFromAST::getCustomDisk(disk_function_ast, context); | ||
| else | ||
| DiskFromAST::ensureDiskIsNotCustom(value.safeGet<String>(), context); |
There was a problem hiding this comment.
normalizeSettingsChanges now runs on both existing table metadata (current_changes) and metadata-derived checks (checkColumnFilenamesForCollision), but this branch rejects any string disk name that points to a custom disk.
That makes existing valid tables with SETTINGS disk = disk(...) fail unrelated ALTER paths after the disk is normalized to its name (same table, no disk change). In other words, we reject pre-existing metadata, not just new user input.
Please split normalization from validation (e.g. normalize-only mode for existing/current metadata, validation only for user-provided new changes), otherwise ensureDiskIsNotCustom introduces a regression for ALTER on tables that already use custom disks.
There was a problem hiding this comment.
I don't think this comment is correct, as the current_changes is taken from the Storage, not MergeTreeData, so it will contain an original definition of the custom disk via disk() which will later be normalized to the name without failing.
|
The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158 |
LLVM Coverage Report
Changed lines: 94.02% (110/117) | lost baseline coverage: 8 line(s) · Uncovered code |
|
@korowa why did you close the pull request? has it been abandoned? |
|
@xeizmendi yes, it's abandoned, and I think it's not sufficient -- if you check
So (just an opinion), in order to support more natural / user-friendly workflow for this usecase, there is more to be done than this PR contains for now. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow alter commands and mutations for MergeTree tables with plain_rewritable metadata.
Documentation entry for user-facing changes
Details
Related to #91611
Since hard links creation is supported by plain_rewritable metadata, and implemented with copying object, make
supportsHardLinks()to return true for plain_rewritable, and allow alter commands to be executed.