30 Commits
Author SHA1 Message Date
Groene AI 3fbb02f2bc Fix clickhouse-disks move of a directory on plain_rewritable disks
`clickhouse-disks --disk <D> move <dir> <newname>` always failed with
`DIRECTORY_ALREADY_EXISTS` on a disk with `metadata_type = plain_rewritable`,
and left a stray empty destination directory behind.

`CommandMove::executeImpl` pre-created the destination and then renamed onto
it. `DiskObjectStorage::createDirectory` and `DiskObjectStorage::moveDirectory`
each open and commit their own transaction, so the pre-created directory was
durably visible to the rename, whose `plain_rewritable` implementation rejects
an existing `path_to`. `DiskLocal::moveDirectory` is `fs::rename`, which
tolerates an existing empty target, so the local path masked this and the
existing `move` coverage (local disk only) never saw it.

Dropping the `createDirectory` call makes the directory move a plain rename,
which is what `moveDirectory` already promises on every backend. The
pre-creation was also strictly more restrictive than the rename it preceded:
non-recursive `createDirectory` requires the target's parent to exist,
while the rename materializes missing intermediate nodes itself. So
`move src aa/bb/cc` with `aa/bb` absent now succeeds on `plain_rewritable`
instead of failing; on a local disk it still fails, with `in rename` rather
than `in create_directory` in the message.

The sibling `createDirectory` call in `CommandCopy` is intentionally left
alone: `copyDirectoryContent` copies into an existing target directory, so
that caller does need it.

The new stateless test runs the same scenarios against a `local` and a
`plain_rewritable` metadata disk and asserts the observable disk state.
`clickhouse-disks` exits 0 even for this failure, so an exit-code oracle
would be vacuous.
2026-08-06 15:28:06 +00:00
Raúl Marín d6ac63c8d2 Style: Forbid the use of quotes for includes (partial) 2025-06-24 13:20:10 +02:00
divanik 89625a2448 Resolve issues 2025-01-20 11:27:19 +00:00
divanik 4991dae4ae Add necessary includes 2025-01-13 10:35:11 +00:00
divanik aed0c7e2cf Fix style check 2025-01-10 17:22:00 +00:00
divanik 4fe695344b Add more logs 2025-01-10 14:24:27 +00:00
divanik 5337b48b92 Add more info logs 2025-01-10 14:13:40 +00:00
divanik e59f1fcac4 Add more logs 2025-01-10 12:48:09 +00:00
Julia Kartseva f610c08124 Merge remote-tracking branch 'origin/master' into refactor-object-storages 2024-10-09 08:22:59 +00:00
Konstantin Bogdanov 67c1e89d90 Apply linter changes 2024-10-06 12:29:20 +02:00
Alexey Milovidov 1fd9b60353 More direct interface of Disk and ObjectStorage 2024-08-11 00:13:40 +02:00
divanik 242b553253 Change unique_ptr creation to shared_ptr 2024-07-01 17:35:07 +00:00
divanik 9e92aed2de Correct style check 2024-07-01 13:24:13 +00:00
divanik fee7da5ed3 Corrected tests 2024-07-01 12:46:17 +00:00
divanik bb0b93f77d Change wrong implementations of copy and move 2024-07-01 11:11:16 +00:00
divanik 752bd00784 Corrected problems and tests 2024-06-14 13:54:12 +00:00
divanik 4ace4006d2 Add documentation for new features in interactive client 2024-06-14 13:02:41 +00:00
divanik a9000bd821 Fix bugs 2024-05-28 13:17:49 +00:00
divanik 846d46075d Remove comments 2024-05-27 12:17:04 +00:00
divanik f7238356d1 Commit from private 2024-05-27 11:44:45 +00:00
Nikolay Degterinsky e8203f8a76 Initialize only required disks 2023-11-30 03:09:55 +00:00
Mike Kot 061bbe13c0 add docs for clickhouse-disks 2023-08-29 12:25:04 +00:00
Alexander Tokmakov 70d1adfe4b Better formatting for exception messages (#45449)
* save format string for NetException

* format exceptions

* format exceptions 2

* format exceptions 3

* format exceptions 4

* format exceptions 5

* format exceptions 6

* fix

* format exceptions 7

* format exceptions 8

* Update MergeTreeIndexGin.cpp

* Update AggregateFunctionMap.cpp

* Update AggregateFunctionMap.cpp

* fix
2023-01-24 00:13:58 +03:00
alesapin 350bacec60 Followup 2022-12-08 18:43:54 +01:00
alesapin 7a223f4956 Slightly better clickhouse disks and remove DiskMemory 2022-12-08 18:20:54 +01:00
Nikolai Kochetov 91043351aa Fixing build. 2022-07-20 20:30:16 +00:00
kssenii 47a118beab More fixes 2022-06-21 16:40:22 +02:00
kssenii 7520bfeab7 Fix 2022-06-16 19:50:09 +02:00
Varinara 6aa9e5d649 Fixe: allow config path at any position 2022-06-06 16:52:58 +03:00
Varinara ed6e8176fe Add basic commands for disk tool (list-disks, list, move, remove, link, copy, read, write) + tests 2022-06-06 16:52:58 +03:00