Commit Graph
91 Commits
Author SHA1 Message Date
Azat KhuzhinandClaude 8ea6465c1e shell-like completion support in clickhouse keeper-client (and quoting for ls)
shell-like completion support in clickhouse keeper-client (handle
completions of arguments in quotes, i.e. 'foo ba', handle escaped
arguments, i.e. foo\ ba, make ls print quoted nodes, if they have
whitespaces)

Also remove on_complete_modify_callback hack, replace it with pure
getCompletions implementation

Co-Authored-By: Claude <[email protected]>
2026-03-16 15:20:12 +01:00
Konstantin Bogdanov 69f3701773 Exit early on empty input 2026-03-03 13:59:57 +01:00
Konstantin Bogdanov fbd81a75e1 Reorder imports 2026-03-03 12:54:14 +01:00
Konstantin Bogdanov e4826cf207 Merge remote-tracking branch 'origin/master' into keeper-completion-continue 2026-03-03 12:53:31 +01:00
Konstantin Bogdanov eea5d12af2 Lint 2026-02-24 10:42:38 +01:00
Konstantin Bogdanov 52f8fa3892 keeper-client: fix command completion and quote handling in path completion
Fix command name completion which was broken because appending a closing
quote before tokenizing caused the tokenizer to misinterpret command
prefixes (e.g. 'ls') as path arguments. Split into two-phase approach:
probe the original prefix to decide command vs path, then append quote
only for path parsing.

Fix double closing quote when TAB is pressed with cursor before an
existing closing quote — strip the old quote so completion re-adds it
with the correct suffix (closing quote for leaves, / for directories).

Remove duplicate methods (askConfirmation, getAbsolutePath, loadCommands)
now provided by KeeperClientBase.

Add PTY-based autocomplete test covering command completion, path
completion, directory trailing slash, leaf closing quote, and drill-down.

Assisted-by: Claude Opus 4.6 via GitHub Copilot
2026-02-24 10:24:24 +01:00
Azat KhuzhinandKonstantin Bogdanov 2303d6813b keeper-client: do not append trailing slash in completion
Everything works without it, and it breaks completion after it appends
leading slash.
2026-02-24 07:28:34 +01:00
Azat KhuzhinandKonstantin Bogdanov 227eb3b39f keeper-client: append double quote in the getCompletions() to pass parser 2026-02-24 07:28:33 +01:00
Azat KhuzhinandKonstantin Bogdanov 764d58df00 keeper-client: do not append trailing double quote (breaks completion) 2026-02-24 07:27:24 +01:00
Azat KhuzhinandKonstantin Bogdanov 7681b60292 keeper-client: remove slash from word delimiters (should break completion) 2026-02-24 07:27:24 +01:00
Azat KhuzhinandKonstantin Bogdanov 8ab3aa3a07 keeper-client: wrap completion of keeper paths into double quotes 2026-02-24 07:27:24 +01:00
Azat KhuzhinandKonstantin Bogdanov 317cac64f9 keeper-client: prepend parent directory to fix completion 2026-02-24 07:27:24 +01:00
Azat KhuzhinandKonstantin Bogdanov 2535c68c82 keeper-client: automatically wrap non-first argument with double quotes
It is too had to add them on your own!
2026-02-24 07:26:49 +01:00
Antonio AndelicandGitHub b5fe4ced60 Merge branch 'master' into enforce-component-name 2026-02-23 15:57:28 +01:00
Alexey MilovidovandGitHub 3aa3b14299 Merge pull request #97644 from ClickHouse/fix-keeper-client-test-race-condition
Fix race condition in KeeperClient test helper causing flaky test_rm_with_version
2026-02-23 03:42:24 +00:00
Alexey MilovidovandClaude Opus 4.6 5bd35fee7c Add comments explaining the BEL separator protocol in keeper-client tests-mode
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-22 21:17:51 +01:00
Alexey MilovidovandClaude Opus 4.6 9ebf3853be Fix race condition in KeeperClient.execute_query causing flaky test_rm_with_version
The `execute_query` method in the Python test helper uses `epoll` to
read from both stdout and stderr of the keeper-client process. When
a command fails, the keeper-client writes the error to stderr and then
the separator to stdout. However, when both events arrive simultaneously
in `epoll.poll()`, the loop could process stdout first, find the
separator, and return successfully without ever reading the pending
stderr error data - causing the exception to be silently swallowed.

Fix both sides:
- C++ (`KeeperClient.cpp`): flush stderr before writing the stdout
  separator, ensuring error data is in the pipe buffer first.
- Python (`keeper_utils.py`): process stderr events before stdout
  events in the poll loop, so errors are always collected before
  checking the separator.

Also fix test cleanup: add `try/finally` with `drop_node_if_exists`
to `test_rm_with_version` and `test_rm_without_version`, and give
`test_rm_without_version` its own unique node path instead of
reusing `/test_rm_with_version_node`.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97554&sha=3f86a6142c6920239c1b3adedfe82ccb5fcd6515&name_0=PR&name_1=Integration%20tests%20%28amd_binary%2C%204%2F5%29

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-22 21:17:51 +01:00
Raúl MarínandClaude Opus 4.6 9aa8e4ed27 Move ErrnoException from Exception.h to its own header
Extract `ErrnoException` into `Common/ErrnoException.h` to reduce the
include footprint of `Exception.h`. This removes `<base/errnoToString.h>`
and `<cerrno>` from `Exception.h`, which is included by ~95% of all
translation units.

All files referencing `ErrnoException` now include the new header
directly. Files that used `errnoToString` without `ErrnoException`
got an explicit `<base/errnoToString.h>` include.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 13:47:23 +01:00
Antonio Andelic 18453e8dac Add component names 2026-02-06 18:36:29 +01:00
pufit f94ff23aa1 Fix issue with session reconnects
Better UI
2025-12-30 03:17:56 -05:00
pufit e8f282d62a Merge branch 'master' into ch-keeper-http-api-v1
# Conflicts:
#	programs/keeper-client/KeeperClient.cpp
#	programs/keeper-client/KeeperClient.h
#	programs/server/Server.cpp
#	src/Server/HTTPRequestHandlerFactoryMain.cpp
2025-12-29 19:46:51 -05:00
Alexey MilovidovandGitHub 2e3fcd24ef Merge pull request #88065 from chhetripradeep/pchhetri/keeper-client-tls-auth
clickhouse-keeper-client: Add support to connect to tls port of clickhouse-keeper
2025-10-16 19:27:11 +02:00
Mikhail Artemenko 251b28f1bb implement cpr mvr 2025-10-15 11:34:35 +00:00
chhetripradeep f142cd2936 keeper-client: add support to connect to tls-only keeper 2025-10-03 19:27:06 +08:00
Michael Stetsyuk 761aea0027 fix keeper client 2025-09-09 16:33:31 +00:00
Michael Stetsyuk 02260a224d pass zookeeper args directly 2025-09-09 09:20:09 +00:00
Antonio Andelic 43f6f91207 Add GetACL request to KeeperClient 2025-07-29 09:27:31 +02:00
Raúl MarínandGitHub aa691e4f95 Merge pull request #82483 from Algunenano/includes_utils
Style: Forbid the use of quotes for includes (partial)
2025-06-26 11:41:55 +00:00
Antonio Andelic 22559a31f9 Fix tests with keeper client 2025-06-25 14:15:41 +02:00
Raúl Marín d6ac63c8d2 Style: Forbid the use of quotes for includes (partial) 2025-06-24 13:20:10 +02:00
pufit 3dabac5c0b Merge branch 'master' into ch-keeper-http-api-v1
# Conflicts:
#	src/Server/HTTP/HTTPServerRequest.h
2025-06-14 01:04:19 -04:00
pufit 8a55953def Fix build, fix style, small refactoring 2025-06-14 01:03:37 -04:00
pufit ea2f67c244 Fix copypaste 2025-06-09 20:03:17 -04:00
pufit ee5dfdd130 Make naming consistent 2025-06-09 19:58:01 -04:00
Michael Stetsyuk d195c257b7 mark exceptions as logged 2025-06-06 13:40:27 +00:00
pufit ac6c202a88 KeeperClient over Dispatcher 2025-05-03 01:08:55 -04:00
Nikita Mikhaylov ee12273297 Improve the SSH protocol 2025-03-18 14:53:35 +01:00
Azat Khuzhin 550472fbec keeper-client: suppress "Finalizing session {}" message 2025-02-20 18:40:16 +01:00
Azat Khuzhin 5de42d0c63 keeper-client: add missing new line on exit 2025-02-20 18:40:09 +01:00
alesapinandGitHub a14feb1650 Update programs/keeper-client/KeeperClient.cpp 2025-01-17 20:42:09 +01:00
alesapin 136321f023 Fix clickhouse keeper-client as well 2025-01-16 19:02:21 +01:00
Gamezardashvili GeorgeandNikita Mikhaylov dce8775516 SSH Authentication 2025-01-08 11:53:53 +01:00
Sema Checherinda f1ab911910 cancel or finalize write buffer 2024-11-11 11:37:12 +01:00
Alexey Milovidov c8104cb2ee Correct and unify exit codes 2024-11-07 21:31:07 +01:00
Vladimir CherkasovandGitHub c4db9a0501 Merge pull request #71014 from jirislav/increase_default_client_history_size
Make the Replxx client history size configurable
2024-11-01 14:04:00 +00:00
Jiří Kozlovský de8c5eaed0 Make the Replxx client history size configurable 2024-10-24 16:10:56 +02:00
Antonio Andelic ab05f8b6e8 Fix Keeper entry serialization compatibility 2024-10-23 16:41:16 +02:00
Mikhail Artemenko 7f613563e1 initial impl for cp/mv 2024-08-28 13:39:29 +00:00
Azat Khuzhin e623ad041f Make C-z ignorance configurable (ignore_shell_suspend) in clickhouse-client
C-z is extermelly useful for some users (like myself), so provide a way
to configure it in client and avoid it's ignorance in clickhouse-disks
(I hope it is OK since it is not that known utility and it does not have
it's own configuration, while cli option is useless, one should remeber
about it).

Honestly I've never seen any interactive client that forbids C-z, so
ignoring it my default looks strange to me.

Signed-off-by: Azat Khuzhin <[email protected]>
2024-08-19 08:33:53 +02:00
Alexander TokmakovandGitHub 4748e2929f Merge pull request #65570 from ClickHouse/keeper_az
Improve ZooKeeper load balancing
2024-06-28 22:57:20 +00:00