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
68 changes: 8 additions & 60 deletions .github/workflows/build_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,80 +153,27 @@ jobs:
conan export --user oss --channel main import/nuraft_mesg
if: ${{ inputs.testing == 'True' || steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Build Cache
- name: Create and Test Package
run: |
conan install \
-c tools.build:skip_test=True \
sanitize=$([[ "${{ inputs.tooling }}" == "Sanitize" ]] && echo "True" || echo "False")
conan build \
-o sisl/*:malloc_impl=${{ inputs.malloc-impl }} \
-o iomgr/*:testing=off \
-o homestore/*:testing=off \
-o homeblocks/*:sanitize=${sanitize} \
-s:h build_type=${{ inputs.build-type }} \
-c tools.build:skip_test=True \
-s:h compiler.cppstd=23 \
--format=json \
--build missing \
. > ~/build.json
conan list --graph ~/build.json --graph-binaries=build --format=json > ~/pkglist.json
if: ${{ steps.restore-cache.outputs.cache-hit != 'true' }}
if: ${{ inputs.testing == 'True' && inputs.tooling != 'Coverage' }}

- name: Save Conan Cache
uses: eBay/sisl/.github/actions/store_conan2@master
with:
key_prefix: HomeBlocksDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}
if: ${{ github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Reload Sisl Cache
uses: eBay/sisl/.github/actions/load_conan2@master
with:
load_any: 'True'
key_prefix: SislDeps13-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}
if: ${{ inputs.testing == 'True' && github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Reload IOMgr Cache
uses: eBay/sisl/.github/actions/load_conan2@master
with:
load_any: 'True'
key_prefix: IOMgrDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}-False
if: ${{ inputs.testing == 'True' && github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Reload NuRaftMesg Cache
uses: eBay/sisl/.github/actions/load_conan2@master
with:
testing: 'False'
path: import/nuraft_mesg
key_prefix: NuMesgDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}
fail_on_cache_miss: true
if: ${{ inputs.testing == 'True' && github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- name: Reload HomeStore Cache
uses: eBay/sisl/.github/actions/load_conan2@master
with:
testing: 'False'
path: import/homestore
key_prefix: HomestoreDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}-False
fail_on_cache_miss: true
if: ${{ inputs.testing == 'True' && github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' }}

- uses: actions/checkout@main
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
detached: true
connect-timeout-seconds: 60
if: ${{ inputs.testing == 'True' }}

- name: Create and Test Package
run: |
sanitize=$([[ "${{ inputs.tooling }}" == "Sanitize" ]] && echo "True" || echo "False")
conan create \
-o sisl/*:malloc_impl=${{ inputs.malloc-impl }} \
-o iomgr/*:testing=off \
-o homestore/*:testing=off \
-o homeblocks/*:sanitize=${sanitize} \
-s:h build_type=${{ inputs.build-type }} \
--build missing \
.
if: ${{ inputs.testing == 'True' && inputs.tooling != 'Coverage' }}
if: ${{ github.event_name != 'pull_request' && steps.restore-cache.outputs.cache-hit != 'true' && inputs.tooling != 'Coverage'}}

- name: Code Coverage Run
run: |
Expand All @@ -236,6 +183,7 @@ jobs:
-o homestore/*:testing=off \
-o homeblocks/*:coverage=True \
-s:h build_type=${{ inputs.build-type }} \
-s:h compiler.cppstd=23 \
--build missing \
.
if: ${{ inputs.testing == 'True' && inputs.tooling == 'Coverage' }}
Expand Down
6 changes: 3 additions & 3 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ pipeline {

stage("Compile") {
steps {
sh "conan create ${BUILD_MISSING} -s:h build_type=Debug -o ${PROJECT}/*:sanitize=True ${CONAN_FLAGS} . ; \
conan create ${BUILD_MISSING} -s:h build_type=Debug ${CONAN_FLAGS} . ; \
conan create ${BUILD_MISSING} -s:h build_type=RelWithDebInfo -o sisl/*:malloc_impl=tcmalloc ${CONAN_FLAGS} . ; \
sh "conan build -s:h compiler.cppstd=23 ${BUILD_MISSING} -s:h build_type=Debug -o ${PROJECT}/*:sanitize=True ${CONAN_FLAGS} . ; \
conan create -s:h compiler.cppstd=23 ${BUILD_MISSING} -s:h build_type=Debug ${CONAN_FLAGS} . ; \
conan create -s:h compiler.cppstd=23 ${BUILD_MISSING} -s:h build_type=RelWithDebInfo -o sisl/*:malloc_impl=tcmalloc ${CONAN_FLAGS} . ; \
"
}
}
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.11)
project (homeblocks LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)

if (NOT DEFINED CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Debug")
Expand Down
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomeBlocksConan(ConanFile):
name = "homeblocks"
version = "4.0.1"
version = "5.0.0"

homepage = "https://github.com/eBay/HomeBlocks"
description = "Block Store built on HomeStore"
Expand Down Expand Up @@ -52,7 +52,7 @@ def requirements(self):

def validate(self):
if self.info.settings.compiler.cppstd:
check_min_cppstd(self, 20)
check_min_cppstd(self, 23)

def layout(self):
self.folders.source = "."
Expand Down
10 changes: 5 additions & 5 deletions src/include/homeblks/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*********************************************************************************/
#pragma once

#include <expected>

#include <boost/uuid/uuid.hpp>
#include <boost/intrusive_ptr.hpp>
#include <folly/Expected.h>
#include <folly/Unit.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Expand Down Expand Up @@ -74,12 +74,12 @@ template < class E >
class Manager {
public:
template < typename T >
using Result = folly::Expected< T, E >;
using Result = std::expected< T, E >;
template < typename T >
using AsyncResult = folly::Future< Result< T > >;

using NullResult = Result< folly::Unit >;
using NullAsyncResult = AsyncResult< folly::Unit >;
using NullResult = Result< void >;
using NullAsyncResult = AsyncResult< void >;

virtual ~Manager() = default;
};
Expand Down
4 changes: 2 additions & 2 deletions src/include/homeblks/volume_mgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ struct vol_interface_req : public sisl::ObjLifeCounter< vol_interface_req > {
VolumePtr vol{nullptr}; // back ref to the volume this request is associated with.
Clock::time_point io_start_time; // time when the request reaches homeblks.
Clock::time_point data_svc_start_time; // time when the request to data service starts.
Clock::time_point index_start_time; // time when the request to index service starts.
Clock::time_point journal_start_time; // time when the request to journal service starts.
Clock::time_point index_start_time; // time when the request to index service starts.
Clock::time_point journal_start_time; // time when the request to journal service starts.

friend void intrusive_ptr_add_ref(vol_interface_req* req) { req->refcount.increment(1); }
friend void intrusive_ptr_release(vol_interface_req* req);
Expand Down
10 changes: 5 additions & 5 deletions src/lib/volume/index_fixed_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ class VolumeIndexTable {
LOGERROR("Failed to put to index {}, error={}", lba, result);
// rollback the lbas for which we have already written to the index table
rollback_write(start_lba, lba - 1, blocks_info);
return folly::makeUnexpected(VolumeError::INDEX_ERROR);
return std::unexpected(VolumeError::INDEX_ERROR);
}
}

return folly::Unit();
}

VolumeManager::Result< folly::Unit > read_from_index(const vol_interface_req_ptr& req, index_kv_list_t& index_kvs) {
VolumeManager::NullResult read_from_index(const vol_interface_req_ptr& req, index_kv_list_t& index_kvs) {
homestore::BtreeQueryRequest< VolumeIndexKey > qreq{
homestore::BtreeKeyRange< VolumeIndexKey >{VolumeIndexKey{req->lba}, VolumeIndexKey{req->end_lba()}},
homestore::BtreeQueryType::SWEEP_NON_INTRUSIVE_PAGINATION_QUERY};
if (auto ret = hs_index_table_->query(qreq, index_kvs); ret != homestore::btree_status_t::success) {
return folly::makeUnexpected(VolumeError::INDEX_ERROR);
return std::unexpected(VolumeError::INDEX_ERROR);
}
return folly::Unit();
return {};
}

void rollback_write(lba_t start_lba, lba_t end_lba, std::unordered_map< lba_t, BlockInfo >& blocks_info) {
Expand Down Expand Up @@ -110,4 +110,4 @@ class VolumeIndexTable {
}
};

} // namespace homeblocks
} // namespace homeblocks
6 changes: 3 additions & 3 deletions src/lib/volume/index_prefix_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class VolumeIndexTable {
auto result = hs_index_table_->put(req);
if (result != homestore::btree_status_t::success) {
LOGERROR("Failed to put to index range=({},{}) error={}", start_lba, end_lba, result);
return folly::makeUnexpected(VolumeError::INDEX_ERROR);
return std::unexpected(VolumeError::INDEX_ERROR);
}

return folly::Unit();
Expand All @@ -59,7 +59,7 @@ class VolumeIndexTable {
homestore::BtreeKeyRange< VolumeIndexKey >{VolumeIndexKey{req->lba}, VolumeIndexKey{req->end_lba()}},
homestore::BtreeQueryType::SWEEP_NON_INTRUSIVE_PAGINATION_QUERY};
if (auto ret = hs_index_table_->query(qreq, index_kvs); ret != homestore::btree_status_t::success) {
return folly::makeUnexpected(VolumeError::INDEX_ERROR);
return std::unexpected(VolumeError::INDEX_ERROR);
}
return folly::Unit();
}
Expand All @@ -70,4 +70,4 @@ class VolumeIndexTable {
}
};

} // namespace homeblocks
} // namespace homeblocks
14 changes: 7 additions & 7 deletions src/lib/volume/tests/test_volume_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class VolumeIOImpl {
vol_mgr->write(m_vol_ptr, req)
.via(&folly::InlineExecutor::instance())
.thenValue([this, data, req, latch, expect_failure](auto&& result) {
ASSERT_EQ(result.hasError(), expect_failure);
ASSERT_EQ(!result.has_value(), expect_failure);
{
std::lock_guard lock(m_mutex);
m_inflight_ios.erase(boost::icl::interval< int >::closed(req->lba, req->lba + req->nlbas - 1));
Expand Down Expand Up @@ -245,7 +245,7 @@ class VolumeIOImpl {
vol_mgr->write(m_vol_ptr, req)
.via(&folly::InlineExecutor::instance())
.thenValue([this, req, data](auto&& result) {
RELEASE_ASSERT(!result.hasError(), "Write failed with error={}", result.error());
RELEASE_ASSERT(result.has_value(), "Write failed with error={}", result.error());
{
std::lock_guard lock(m_mutex);
m_inflight_ios.erase(boost::icl::interval< int >::closed(req->lba, req->lba + req->nlbas - 1));
Expand All @@ -262,8 +262,8 @@ class VolumeIOImpl {
auto buf = read_blob.bytes();
vol_interface_req_ptr req(new vol_interface_req{buf, start_lba, nlbas, m_vol_ptr});
auto read_resp = g_helper->inst()->volume_manager()->read(m_vol_ptr, req).get();
if (read_resp.hasError()) { LOGERROR("Read failed with error={}", read_resp.error()); }
RELEASE_ASSERT(!read_resp.hasError(), "Read failed with error={}", read_resp.error());
if (!read_resp.has_value()) { LOGERROR("Read failed with error={}", read_resp.error()); }
RELEASE_ASSERT(read_resp.has_value(), "Read failed with error={}", read_resp.error());
}

void read_and_verify(lba_t start_lba, uint32_t nlbas) {
Expand All @@ -273,8 +273,8 @@ class VolumeIOImpl {
auto buf = read_blob.bytes();
vol_interface_req_ptr req(new vol_interface_req{buf, start_lba, nlbas, m_vol_ptr});
auto read_resp = g_helper->inst()->volume_manager()->read(m_vol_ptr, req).get();
if (read_resp.hasError()) { LOGERROR("Read failed with error={}", read_resp.error()); }
RELEASE_ASSERT(!read_resp.hasError(), "Read failed with error={}", read_resp.error());
if (!read_resp.has_value()) { LOGERROR("Read failed with error={}", read_resp.error()); }
RELEASE_ASSERT(read_resp.has_value(), "Read failed with error={}", read_resp.error());
auto read_sz = m_vol_ptr->info()->page_size;
for (auto lba = start_lba; lba < start_lba + nlbas; lba++, buf += read_sz) {
uint64_t data_pattern = 0;
Expand Down Expand Up @@ -305,7 +305,7 @@ class VolumeIOImpl {
->read(m_vol_ptr, req)
.via(&folly::InlineExecutor::instance())
.thenValue([this, read_blob = std::move(read_blob), req](auto&& result) {
RELEASE_ASSERT(!result.hasError(), "Read failed with error={}", result.error());
RELEASE_ASSERT(result.has_value(), "Read failed with error={}", result.error());
{
std::lock_guard lock(m_mutex);
m_inflight_ios.erase(boost::icl::interval< int >::closed(req->lba, req->lba + req->nlbas - 1));
Expand Down
Loading