vector-search: reset DNS timeout after changing host

The vector-search client in ScyllaDB limits itself to doing one DNS
lookup per 5 seconds. However, when the configuration changes to point
to a different host, the DNS lookup should happen immediately, and
this patch makes it do that.

Before this patch,
     test/cqlpy/run test_vector_search_with_vector_store_mock.py

Takes a whopping 34 seconds, more than 4 seconds per test!
The problem is that each test creates a new mock vector-store server
and reconfigures Scylla, and when reconfiguring Scylla nothing happens
until the 5-second clock runs out.

After this patch, the same test run is down to 5 seconds.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>
This commit is contained in:
Nadav Har'El
2026-05-13 14:49:00 +03:00
parent 5d6f160129
commit 00bad34f12

View File

@@ -41,6 +41,7 @@ public:
void hosts(std::vector<seastar::sstring> hosts) {
_addresses.clear();
_hosts = std::move(hosts);
_last_refresh = {}; // reset throttle so the refresh happens immediately
trigger_refresh();
}