diff --git a/db/system_distributed_keyspace.cc b/db/system_distributed_keyspace.cc index f872a7f099..f037ac1078 100644 --- a/db/system_distributed_keyspace.cc +++ b/db/system_distributed_keyspace.cc @@ -525,6 +525,18 @@ system_distributed_keyspace::cdc_get_versioned_streams(db_clock::time_point not_ co_return result; } +future +system_distributed_keyspace::cdc_current_generation_timestamp(context ctx) { + auto timestamp_cql = co_await _qp.execute_internal( + format("SELECT time FROM {}.{} WHERE key = ? limit 1", NAME, CDC_TIMESTAMPS), + quorum_if_many(ctx.num_token_owners), + internal_distributed_query_state(), + { CDC_TIMESTAMPS_KEY }, + false); + + co_return timestamp_cql->one().get_as("time"); +} + future> system_distributed_keyspace::get_cdc_desc_v1_timestamps(context ctx) { std::vector res; diff --git a/db/system_distributed_keyspace.hh b/db/system_distributed_keyspace.hh index cf434749d5..7be342df60 100644 --- a/db/system_distributed_keyspace.hh +++ b/db/system_distributed_keyspace.hh @@ -109,6 +109,9 @@ public: future> get_cdc_desc_v1_timestamps(context); future> cdc_get_versioned_streams(db_clock::time_point not_older_than, context); + + future cdc_current_generation_timestamp(context); + }; }