From 90904c4a0e8aa61162b89c69e50c7bac9050a9de Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Wed, 9 Sep 2026 08:37:28 -0700 Subject: [PATCH 1/2] Update C++ core to efc5278 Motivation ---------- The ping collector completed as soon as the number of in-flight pings reached zero, which it can do while the fan-out is still being dispatched. The cluster-level services are pinged from the node list in the configuration the session manager holds, so a ping issued before that configuration arrives registers no reporter for them and completes on the key/value reporters alone. Bucket#ping therefore reported key/value by itself or every service the topology advertises, depending on which won that race. Modifications ------------- The core moves to efc5278, which holds a dispatch scope open across the whole ping fan-out (CXXCBC-1022) so the collector cannot complete while endpoints are still being handed reporters. The range also carries per-thread allocation counting and the migration of the core unit tests onto their new framework. Results ------- Bucket#ping and Cluster#ping report every service the topology advertises, regardless of when they are issued relative to the configuration arriving. test_bucket_ping asserts that a bucket ping reports key/value and nothing else, which stopped being the contract in CXXCBC-845, so that test now fails on every run rather than only when the race goes against it. --- ext/couchbase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/couchbase b/ext/couchbase index b08e9f89..efc52786 160000 --- a/ext/couchbase +++ b/ext/couchbase @@ -1 +1 @@ -Subproject commit b08e9f89ccfd95be21823b53a1c1b6a12841c4c2 +Subproject commit efc527861c906fde055ac9241ff2c4dd8af3f726 From 19874b3df589948261dd6805fc7e4909198d6a87 Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Wed, 9 Sep 2026 08:37:38 -0700 Subject: [PATCH 2/2] Test: assert the service set a bucket ping reports Motivation ---------- test_bucket_ping asserts that a bucket ping reports key/value and nothing else. CXXCBC-845, which added wait_until_ready, also made a bucket-scoped ping cover the cluster-level HTTP services, so the assertion describes a contract the core no longer has and fails on every run. Nothing covered the bucket-scoped path for any service other than key/value. Modifications ------------- The default bucket ping is asserted to report key/value and to cover the same services as a cluster ping, which states the current contract without naming the services a particular cluster happens to deploy. The single-service case takes its service list from the cluster's own ping rather than a fixed one, so it exercises the bucket-scoped filtering for every service the cluster under test deploys, and requires key/value among them so that an empty list cannot satisfy it. Results ------- The comparison against a cluster ping distinguishes the fixed core from the broken one: against a core without CXXCBC-1022 a bucket ping that runs before the configuration reaches the session manager reports key/value alone and the comparison fails. --- test/diagnostics_test.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test/diagnostics_test.rb b/test/diagnostics_test.rb index 6a501eeb..e8355d92 100644 --- a/test/diagnostics_test.rb +++ b/test/diagnostics_test.rb @@ -52,8 +52,22 @@ def test_cluster_ping_single_service def test_bucket_ping res = @bucket.ping - assert_equal 1, res.services.size - assert_equal :kv, res.services.keys[0] + assert_includes res.services.keys, :kv + # Catches a ping collector that completes before the whole fan-out has been + # dispatched (CXXCBC-1022). Comparing against a cluster ping keeps this + # independent of the topology under test. + assert_equal @cluster.ping.services.keys.sort, res.services.keys.sort + end + + def test_bucket_ping_single_service + service_types = @cluster.ping.services.keys + + assert_includes service_types, :kv + service_types.each do |service_type| + res = @bucket.ping(Options::Ping.new(service_types: [service_type])) + + assert_equal [service_type], res.services.keys + end end end end