From 023b5bb3e9b4fa5c11f603a6bd57d0d64551a2a9 Mon Sep 17 00:00:00 2001 From: Andrea Barbadoro Date: Tue, 13 Jun 2023 10:28:53 +0200 Subject: [PATCH] remote_segment::maybe_materialize_index return false on failure previously, a couple of failure paths would a default true, this is a problem for code after this that assumes the existance of objects after this function related to https://github.com/redpanda-data/redpanda/issues/11060 --- src/v/cloud_storage/remote_segment.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/v/cloud_storage/remote_segment.cc b/src/v/cloud_storage/remote_segment.cc index a0c2a0041cc8..d5af02bb528d 100644 --- a/src/v/cloud_storage/remote_segment.cc +++ b/src/v/cloud_storage/remote_segment.cc @@ -654,15 +654,14 @@ ss::future remote_segment::maybe_materialize_index() { "Failed to materialize index '{}'. Error: {}", path, std::current_exception()); + co_return false; } co_await cache_item->body.close(); + co_return true; } else { vlog(_ctxlog.info, "Index '{}' is not available", path); + co_return false; } - - // TODO (abhijat) start returning false here when the index is required to - // be materialized. - co_return true; } // NOTE: Aborted transactions handled using tx_range manifests.