Skip to content

Commit e7399d9

Browse files
committed
archival: Fence spillover command
Signed-off-by: Evgeny Lazin <4lazin@gmail.com>
1 parent 2a7cb4f commit e7399d9

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/v/cluster/archival/ntp_archiver_service.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2996,6 +2996,11 @@ ss::future<> ntp_archiver::apply_spillover() {
29962996
if (!may_begin_uploads()) {
29972997
co_return;
29982998
}
2999+
archival_stm_fence fence = {
3000+
.read_write_fence
3001+
= _parent.archival_meta_stm()->manifest().get_applied_offset(),
3002+
.emit_rw_fence_cmd = emit_read_write_fence(_feature_table),
3003+
};
29993004

30003005
const auto manifest_upload_timeout = _conf->manifest_upload_timeout();
30013006
const auto manifest_upload_backoff = _conf->cloud_storage_initial_backoff();
@@ -3034,6 +3039,12 @@ ss::future<> ntp_archiver::apply_spillover() {
30343039
auto tail = [&]() {
30353040
cloud_storage::spillover_manifest tail(_ntp, _rev);
30363041
for (const auto& meta : manifest()) {
3042+
vlog(
3043+
_rtclog.trace,
3044+
"Adding segment {} to the spillover manifest that starts at "
3045+
"{}",
3046+
meta,
3047+
tail.get_start_offset().value_or(model::offset{}));
30373048
tail.add(meta);
30383049
// No performance impact since all writes here are
30393050
// sequential.
@@ -3090,6 +3101,13 @@ ss::future<> ntp_archiver::apply_spillover() {
30903101
auto deadline = ss::lowres_clock::now() + sync_timeout;
30913102

30923103
auto batch = _parent.archival_meta_stm()->batch_start(deadline, _as);
3104+
if (fence.emit_rw_fence_cmd) {
3105+
vlog(
3106+
_rtclog.debug,
3107+
"spillover, read-write fence: {}",
3108+
fence.read_write_fence);
3109+
batch.read_write_fence(fence.read_write_fence);
3110+
}
30933111
batch.spillover(spillover_meta);
30943112
if (manifest().get_archive_start_offset() == model::offset{}) {
30953113
vlog(

0 commit comments

Comments
 (0)