Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ if (!r) {
}
```
Bridges into non-coroutine code (`detail::detach_then`, `sync_get`, …) live in homestore's coroutine
helpers; the underlying stdexec sender/receiver machinery is hidden - consumers never depend on stdexec
the underlying stdexec sender/receiver machinery is hidden - consumers never depend on stdexec
directly. Errors propagate as `std::error_condition`; exceptions are reserved for precondition bugs.
## 🖥️ Usage
Expand Down
6 changes: 3 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from conan.tools.files import copy
from os.path import join

required_conan_version = ">=1.60.0"
required_conan_version = ">=2.0"

class HomestoreConan(ConanFile):
name = "homestore"
version = "8.2.0"
version = "8.3.0"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down Expand Up @@ -53,7 +53,7 @@ def build_requirements(self):

def requirements(self):
self.requires("iomgr/[^13.0]@oss/dev", transitive_headers=True)
self.requires("sisl/[^14.5]@oss/dev", transitive_headers=True)
self.requires("sisl/[^14.9]@oss/dev", transitive_headers=True)
self.requires("nuraft_mesg/[^5.0]@oss/dev", transitive_headers=True)
if self.settings.arch in ['x86', 'x86_64']:
self.requires("isa-l/[^2.30]", transitive_headers=True)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/blkalloc/blk_cache_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ SlabCacheQueue::SlabCacheQueue(const blk_count_t slab_size, const std::vector< b
const float refill_pct, BlkAllocMetrics* parent_metrics) :
m_slab_size{slab_size}, m_metrics{m_slab_size, this, parent_metrics} {
for (auto& limit : level_limits) {
auto ptr{std::make_unique< BoundedMPMCQueue< blk_cache_entry > >(limit)};
auto ptr{std::make_unique< sisl::BoundedMPMCQueue< blk_cache_entry > >(limit)};
m_level_queues.push_back(std::move(ptr));
m_total_capacity += limit;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/blkalloc/blk_cache_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <vector>

#include <sisl/fds/buffer.hpp>
#include "bounded_mpmc_queue.hpp"
#include <sisl/fds/bounded_mpmc_queue.hpp>

#include "blk_cache.h"

Expand Down Expand Up @@ -75,7 +75,7 @@ class SlabCacheQueue {

private:
blk_count_t m_slab_size; // Slab size in-terms of number of pages
std::vector< std::unique_ptr< BoundedMPMCQueue< blk_cache_entry > > > m_level_queues;
std::vector< std::unique_ptr< sisl::BoundedMPMCQueue< blk_cache_entry > > > m_level_queues;
std::atomic< uint64_t > m_refill_session{0}; // Is a refill pending for this slab
blk_num_t m_total_capacity{0};
blk_num_t m_refill_threshold_limits; // For every level whats their threshold limit size
Expand Down
64 changes: 0 additions & 64 deletions src/lib/blkalloc/bounded_mpmc_queue.hpp

This file was deleted.

5 changes: 3 additions & 2 deletions src/lib/blkalloc/fixed_blk_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
*********************************************************************************/
#pragma once

#include <sisl/fds/bounded_mpmc_queue.hpp>

#include "bitmap_blk_allocator.h"
#include "bounded_mpmc_queue.hpp"

namespace homestore {
/* FixedBlkAllocator is a fast allocator where it allocates only 1 size block and ALL free blocks are cached instead
Expand Down Expand Up @@ -55,6 +56,6 @@ class FixedBlkAllocator : public BitmapBlkAllocator {
state_t m_state{state_t::RECOVERING};
std::unordered_set< blk_num_t > m_reserved_blks; // Keep track of all blks which are reserved as allocated
std::mutex m_reserve_blk_mtx; // Mutex used while removing marked_blks from blk_q
BoundedMPMCQueue< blk_num_t > m_free_blk_q;
sisl::BoundedMPMCQueue< blk_num_t > m_free_blk_q;
};
} // namespace homestore
23 changes: 9 additions & 14 deletions src/lib/checkpoint/cp_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@
#include "common/homestore_assert.hpp"
#include "common/homestore_config.hpp"
#include "common/resource_mgr.hpp"
#include "common/coro_helpers.hpp" // detail::detach (fire-and-forget the flush coroutine)
#include <sisl/async/coro.hpp>
#include "cp_internal.hpp"

namespace homestore {
thread_local std::stack< CP* > CPGuard::t_cp_stack;

namespace {
// trigger_cp_flush returns a task<bool> awaiting the CP's broadcast completion. do_trigger_cp_flush does its
// switchover synchronously (callers fire-and-forget that side effect) and hands back one of these awaiters.
sisl::async::task< bool > await_shared(std::shared_ptr< sisl::async::shared_awaitable< bool > > comp) {
co_return co_await *comp;
}
sisl::async::task< bool > ready_bool(bool v) { co_return v; }
} // namespace

Expand All @@ -52,7 +47,7 @@ CPManager::CPManager() :

resource_mgr().register_dirty_buf_exceed_cb([this]([[maybe_unused]] int64_t dirty_buf_count, bool critical) {
LOGINFO("Dirty buffer exceeded count {} critical {}", dirty_buf_count, critical);
detail::detach(this->trigger_cp_flush(false /* force */));
sisl::async::detach(this->trigger_cp_flush(false /* force */));
});

start_timer_thread();
Expand Down Expand Up @@ -113,7 +108,7 @@ void CPManager::start_timer() {
m_cp_timer_hdl = iomanager.schedule_thread_timer(
usecs * 1000, true /* recurring */, nullptr /* cookie */, [this](void*, uint64_t exp_count) {
if (exp_count > 1) { LOGINFO("cp timer expired {} times, running once", exp_count); }
detail::detach(trigger_cp_flush(false));
sisl::async::detach(trigger_cp_flush(false));
});
});
}
Expand Down Expand Up @@ -142,11 +137,11 @@ void CPManager::shutdown(bool require_extra_cp) {
}

LOGINFO("Trigger cp flush at CP shutdown");
auto success = detail::sync_get(do_trigger_cp_flush(true /* force */, true /* flush_on_shutdown */));
auto success = sisl::async::sync_get(do_trigger_cp_flush(true /* force */, true /* flush_on_shutdown */));
HS_REL_ASSERT_EQ(success, true, "CP Flush failed");

if (require_extra_cp) {
success = detail::sync_get(do_trigger_cp_flush(true /* force */, true /* flush_on_shutdown */));
success = sisl::async::sync_get(do_trigger_cp_flush(true /* force */, true /* flush_on_shutdown */));
HS_REL_ASSERT_EQ(success, true, "CP Flush failed");
}

Expand Down Expand Up @@ -201,7 +196,7 @@ void CPManager::cp_io_exit(CP* cp) {
HS_DBG_ASSERT_NE(cp->m_cp_status, cp_status_t::cp_flushing);
if (cp->m_enter_cnt.decrement_testz(1) && (cp->m_cp_status == cp_status_t::cp_flush_prepare)) {
m_wd_cp->set_cp(cp);
detail::detach(cp_start_flush(cp)); // fire-and-forget the flush coroutine
sisl::async::detach(cp_start_flush(cp)); // fire-and-forget the flush coroutine
}
}

Expand All @@ -228,7 +223,7 @@ sisl::async::task< bool > CPManager::do_trigger_cp_flush(bool force, bool flush_
}

// If multiple threads call trigger, they all await the same shared_awaitable (broadcast).
return await_shared(m_pending_trigger_cp_comp);
return sisl::async::await_shared(m_pending_trigger_cp_comp);
} else {
return ready_bool(false);
}
Expand Down Expand Up @@ -281,7 +276,7 @@ sisl::async::task< bool > CPManager::do_trigger_cp_flush(bool force, bool flush_
lk.unlock();

HS_PERIODIC_LOG(DEBUG, cp, "CP critical section done, doing cp_io_exit");
return await_shared(comp);
return sisl::async::await_shared(comp);
}

sisl::async::task< void > CPManager::cp_start_flush(CP* cp) {
Expand Down Expand Up @@ -342,7 +337,7 @@ void CPManager::on_cp_flush_done(CP* cp) {
if (trigger_back_2_back_cp) {
HS_PERIODIC_LOG(INFO, cp, "Triggering back to back CP");
COUNTER_INCREMENT(*m_metrics, back_to_back_cps, 1);
detail::detach(trigger_cp_flush(false));
sisl::async::detach(trigger_cp_flush(false));
}
}

Expand Down
123 changes: 0 additions & 123 deletions src/lib/common/coro_helpers.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions src/lib/device/journal_vdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "replication/repl_dev/raft_repl_dev.h"
#include "device/chunk.h"
#include "device/device.h"
#include "common/coro_helpers.hpp" // detail::detach (fire-and-forget the journal-exceed CP flush)
#include <sisl/async/coro.hpp>
#include "device/physical_dev.hpp"
#include "device/journal_vdev.hpp"
#include "common/error.h"
Expand Down Expand Up @@ -59,7 +59,7 @@ JournalVirtualDev::JournalVirtualDev(DeviceManager& dmgr, const vdev_info& vinfo

resource_mgr().register_journal_vdev_exceed_cb([this]([[maybe_unused]] int64_t dirty_buf_count, bool critical) {
// either it is critical or non-critical, call cp_flush;
detail::detach(hs()->cp_mgr().trigger_cp_flush(false /* force */));
sisl::async::detach(hs()->cp_mgr().trigger_cp_flush(false /* force */));

if (critical) {
LOGINFO("Critical journal vdev size threshold reached. Triggering truncate.");
Expand Down
Loading
Loading