From 1d0773036eabc335be2c9f7135ad014f4934b584 Mon Sep 17 00:00:00 2001 From: Ben Pope Date: Mon, 24 Jun 2024 15:11:16 +0100 Subject: [PATCH] schema_registry: has_version no longer ignores inc_del Signed-off-by: Ben Pope (cherry picked from commit 4261670a709379a22a995bc1a49597eff5071bfc) --- src/v/pandaproxy/schema_registry/store.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v/pandaproxy/schema_registry/store.h b/src/v/pandaproxy/schema_registry/store.h index 073e0f513f213..85203c293272b 100644 --- a/src/v/pandaproxy/schema_registry/store.h +++ b/src/v/pandaproxy/schema_registry/store.h @@ -398,8 +398,8 @@ class store { const subject& sub, schema_id id, include_deleted inc_del) const { auto sub_it = BOOST_OUTCOME_TRYX(get_subject_iter(sub, inc_del)); const auto& vs = sub_it->second.versions; - return std::any_of(vs.cbegin(), vs.cend(), [id](const auto& entry) { - return entry.id == id; + return absl::c_any_of(vs, [id, inc_del](const auto& entry) { + return entry.id == id && (inc_del || !entry.deleted); }); }