@@ -580,12 +580,13 @@ ss::future<result<raft::replicate_result>> do_upload_and_replicate(
580580 co_return default_errc;
581581 }
582582 auto fence = std::move (fence_fut.get ());
583- if (!fence.unit . has_value ()) {
583+ if (!fence.has_value ()) {
584584 vlog (
585585 cd_log.warn ,
586- " Failed to fence epoch {} for ntp {}, fence unit is empty " ,
586+ " Failed to fence epoch {} for ntp {}, ctp latest seen epoch is {} " ,
587587 upload_res.value ().front ().id .epoch ,
588- ntp);
588+ ntp,
589+ fence.error ().latest_seen );
589590 co_return default_errc;
590591 }
591592
@@ -605,7 +606,7 @@ ss::future<result<raft::replicate_result>> do_upload_and_replicate(
605606 co_await ticket.redeem ();
606607 }
607608 // Replicate now that our ticket is redeemed
608- opts = update_replicate_options (opts, fence. term );
609+ opts = update_replicate_options (opts, fence-> term );
609610 auto replicate_stages = partition->replicate_in_stages (
610611 batch_id, std::move (placeholders.batches .front ()), opts);
611612 // Once the request is enqueued in raft and our order is guaranteed we can
@@ -722,14 +723,13 @@ ss::future<std::expected<kafka::offset, std::error_code>> frontend::replicate(
722723 std::rethrow_exception (e);
723724 }
724725 auto fence = std::move (fence_fut.get ());
725- if (!fence.unit . has_value ()) {
726+ if (!fence.has_value ()) {
726727 vlog (
727728 cd_log.warn ,
728- " Failed to fence epoch {} for ntp {}, fence unit is empty " ,
729+ " Failed to fence epoch {} for ntp {}, ctp latest seen epoch is {} " ,
729730 res.value ().front ().id .epoch ,
730- ntp ());
731-
732- // / TODO: Maybe return different error code here?
731+ ntp (),
732+ fence.error ().latest_seen );
733733 co_return std::unexpected (
734734 kafka::make_error_code (kafka::error_code::request_timed_out));
735735 }
@@ -741,7 +741,7 @@ ss::future<std::expected<kafka::offset, std::error_code>> frontend::replicate(
741741 placeholder_batches.push_back (std::move (batch));
742742 }
743743
744- opts = update_replicate_options (opts, fence. term );
744+ opts = update_replicate_options (opts, fence-> term );
745745 auto result = co_await _partition->replicate (
746746 std::move (placeholder_batches), opts);
747747
0 commit comments