3 Commits
Author SHA1 Message Date
dependabot[bot] 820dfa8d31 Bump org.apache.zookeeper:zookeeper
Bumps org.apache.zookeeper:zookeeper from 3.8.4 to 3.8.6.

---
updated-dependencies:
- dependency-name: org.apache.zookeeper:zookeeper
  dependency-version: 3.8.6
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 10:03:35 +00:00
Antonio AndelicandClaude Opus 4.6 de1f96a181 Fix flaky test_keeper_java_client integration tests
Fix two issues causing flaky failures in `test_keeper_java_client`:

1. `test_remove_watches`: The Java watcher was counting all event types
   including asynchronous `PersistentWatchRemoved` notifications generated
   by the ZK 3.8 client when `removeAllWatches` succeeds. This caused a
   race between the EventThread delivering the removal event and the main
   thread capturing `countBefore`. Fix: filter to only count
   `NodeDataChanged` events.

2. `test_addwatch` (and all tests): The Java client resolved `localhost`
   to IPv6 `[::1]` first, but the Docker container's Keeper was not
   reachable on IPv6, causing `Connection refused`. The 10s connect
   timeout expired before the client retried on IPv4. Fix: use the
   container IP via `cluster.get_instance_ip` instead of `localhost`,
   matching the pattern used by `test_paimon_rest_catalog`.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=d67a6f693a4deabb3f90936c12c35cd5ced61bf3&name_0=MasterCI&name_1=Integration%20tests%20%28amd_binary%2C%203%2F5%29
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=4fe25262e1c78bd7b61df6ca18df0fd1586742b1&name_0=MasterCI&name_1=Integration%20tests%20%28amd_binary%2C%202%2F5%29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:36:22 +01:00
Antonio AndelicandClaude Opus 4.6 5a4a07a38d Fix Keeper disconnect after addWatch with Java ZooKeeper client
The Java ZooKeeper client uses `ErrorResponse` as the response type for
`addWatch`, which expects a 4-byte error code in the response body.
ClickHouse Keeper was sending an empty body, causing the client to get
`EOFException` when trying to read the error code, which triggered a
disconnect. This broke CuratorCache startup and any Java application
using persistent watches.

The fix adds the 4-byte error body to `ZooKeeperAddWatchResponse`,
matching what real ZooKeeper sends (`new ErrorResponse(0)`).

Also fixes `ZooKeeperCheckWatchRequest::makeResponse` and
`ZooKeeperRemoveWatchRequest::makeResponse` which incorrectly returned
`ZooKeeperAddWatchResponse` instead of their own response types.

Adds a new integration test (`test_keeper_java_client`) that validates
all 5 watch-related request types using the actual Java ZooKeeper client
library (3.8.4).

Un-skips `test_persistent_watches_cleanup_on_close`.

Closes https://github.com/ClickHouse/ClickHouse/issues/98079

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:32:19 +01:00