`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.
* 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