cdc, vector: fix CDC result tracker for vector indexes

When a table has a vector index, cdc::cdc_enabled() returns true because
vector index writes are implemented via the CDC augmentation path. However,
register_cdc_operation_result_tracker() was checking only
cdc_options().enabled(), which is false for tables that have a vector index
but not traditional CDC.

As a result, the operation_result_tracker was never attached to write
response handlers for vector-indexed tables. This tracker was added in
commit 1b92cbe, and its job is to update metrics of CDC operations,
and since vector search really does use CDC under the hood, these
metrics could be useful when diagnosing problems.

Fix by using cdc::cdc_enabled() instead of cdc_options().enabled(), which
covers both traditional CDC and vector-indexed tables.

Signed-off-by: Nadav Har'El <nyh@scylladb.com>

Closes scylladb/scylladb#29343
This commit is contained in:
Nadav Har'El
2026-04-06 11:45:35 +03:00
committed by Botond Dénes
parent 8c629d55b0
commit f590ee2b7e

View File

@@ -3900,7 +3900,7 @@ void storage_proxy::register_cdc_operation_result_tracker(const storage_proxy::u
for (auto& id : ids) {
auto& h = get_write_response_handler(id.id);
if (h->get_schema()->cdc_options().enabled()) {
if (cdc::cdc_enabled(*h->get_schema())) {
h->set_cdc_operation_result_tracker(tracker);
}
}