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
29 changes: 22 additions & 7 deletions .github/workflows/build_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ jobs:
runs-on: ${{ inputs.platform }}
timeout-minutes: 1440
steps:
- name: Recover space
run: |
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
df -h

- name: Retrieve Code
uses: actions/checkout@main
with:
Expand Down Expand Up @@ -147,7 +155,6 @@ jobs:
run: |
du -sh ~/.conan2/p | awk '{printf("size=%d\n", $1)}' > $GITHUB_OUTPUT
conan install \
-u \
-o "sisl/*:prerelease=${{ inputs.prerelease }}" \
-o "sisl/*:malloc_impl=${{ inputs.malloc-impl }}" \
-c tools.build:skip_test=True \
Expand All @@ -159,17 +166,27 @@ jobs:
id : remove-prior-deps
run: |
conan remove -c -p "build_type=${{ inputs.build-type }}" '*:*#!latest'
du -sh ~/.conan2/p | awk '{printf("size=%d\n", $1)}' > $GITHUB_OUTPUT
rm -rf ~/.conan2/p/*/b ~/.conan2/p/*/s
rm -rf ~/.conan2/p/b/*/b
rm -rf ~/.conan2/p/*/b ~/.conan2/p/*/s
du -sh ~/.conan2/p | awk '{printf("size=%d\n", $1)}' > $GITHUB_OUTPUT
df -h

- name: Save Cache
- name: Delete Previous Cache
continue-on-error: true
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "HomestoreDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}-${{ inputs.prerelease }}" --confirm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name != 'pull_request' && steps.build-deps.outputs.size != steps.remove-prior-deps.outputs.size }}

- name: Save Dependency Cache
uses: actions/cache/save@v4
with:
path: |
~/.conan2/p
key: HomestoreDeps-${{ inputs.platform }}-${{ inputs.build-type }}-${{ inputs.malloc-impl }}-${{ inputs.prerelease }}
if: ${{ steps.build-deps.outputs.size != steps.remove-prior-deps.outputs.size }}
if: ${{ github.event_name != 'pull_request' && steps.build-deps.outputs.size != steps.remove-prior-deps.outputs.size }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand All @@ -194,8 +211,6 @@ jobs:

- name: Code Coverage Run
run: |
du -sh ~/.conan2/p/*
df -h
conan build \
-o "sisl/*:prerelease=${{ inputs.prerelease }}" \
-o "sisl/*:malloc_impl=${{ inputs.malloc-impl }}" \
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "5.2.1"
version = "5.2.2"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
14 changes: 10 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ set(HOMESTORE_OBJECTS
lib/crc.cpp
)
#target_link_libraries(homestore_objs ${COMMON_DEPS})
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_library(homestore STATIC
${HOMESTORE_OBJECTS}
)
else()
add_library(homestore STATIC
${HOMESTORE_OBJECTS}
)
endif()

add_library(homestore STATIC
${HOMESTORE_OBJECTS}
)
target_compile_definitions (homestore PRIVATE LOG_MODS_V2_SUPPORT)
target_link_libraries(homestore ${COMMON_DEPS})
target_link_libraries(homestore PRIVATE ${COMMON_DEPS})
2 changes: 1 addition & 1 deletion src/include/homestore/btree/btree_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UnderlyingBtree {
// Btree based implementations superblock area
struct BtreeSuperBlock {
static constexpr size_t underlying_btree_sb_size =
IndexSuperBlock::index_impl_sb_size - sizeof(bnodeid_t) - sizeof(uint32_t);
IndexSuperBlock::index_impl_sb_size - sizeof(bnodeid_t) - sizeof(uint64_t) - sizeof(uint32_t);

bnodeid_t root_node_id{empty_bnodeid}; // Btree Root Node ID
uint64_t root_link_version{0};
Expand Down
13 changes: 9 additions & 4 deletions src/include/homestore/btree/detail/btree_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ class BtreeNode : public sisl::ObjLifeCounter< BtreeNode > {

Allocator() :
alloc_btree_node{[](uint32_t size) -> uint8_t* { return new uint8_t[size]; }},
free_btree_node{[](BtreeNode* node) { delete[] uintptr_cast(node); }},
free_btree_node{[](BtreeNode* node) {
node->~BtreeNode();
delete[] uintptr_cast(node);
}},
alloc_node_buf{[](uint32_t size) { return new uint8_t[size]; }},
free_node_buf{[](uint8_t* buf) { delete[] buf; }} {}

Expand Down Expand Up @@ -166,7 +169,6 @@ class BtreeNode : public sisl::ObjLifeCounter< BtreeNode > {
DEBUG_ASSERT_EQ(m_phys_buf_share_count.load(), 0,
"We are being asked to destruct node while its buffer is still shared");
Allocator::get(m_token).free_node_buf(m_phys_node_buf);
if (Allocator::get(m_token).free_btree_node) { Allocator::get(m_token).free_btree_node(this); }
}

// Identify if a node is a leaf node or not, from raw buffer, by just reading PersistentHeader
Expand Down Expand Up @@ -668,8 +670,11 @@ class BtreeNode : public sisl::ObjLifeCounter< BtreeNode > {
if (node->m_refcount.decrement_testz(1)) {
// Do not delete it here, since node is generally an offset inside actual allocation and delete will fail
// here (with asan). So let the on_node_freed from the underlying store delete the allocation.
node->~BtreeNode();
// delete node;
if (Allocator::get(node->m_token).free_btree_node) {
Allocator::get(node->m_token).free_btree_node(node);
} else {
delete node;
}
}
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/lib/checkpoint/cp_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ void CPManager::on_cp_flush_done(CP* cp) {
// checking if shutdown has been initiated or not.
auto promise = std::move(cp->m_comp_promise);
m_wd_cp->reset_cp();
bool is_shutdown_cp = cp->m_is_on_shutdown;
delete cp;

bool trigger_back_2_back_cp{false};
Expand All @@ -281,7 +282,7 @@ void CPManager::on_cp_flush_done(CP* cp) {
}

promise.setValue(true);
if (!cp->m_is_on_shutdown) { // No need of back_2_back cp etc on shutdown.
if (!is_shutdown_cp) { // No need of back_2_back cp etc on shutdown.
// Dont access any cp state after this, in case trigger_back_2_back_cp is false, because its false on
// cp_shutdown_initated and setting this promise could destruct the CPManager itself.
if (trigger_back_2_back_cp) {
Expand Down
9 changes: 6 additions & 3 deletions src/lib/index/cow_btree/cow_btree_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ COWBtreeStore::COWBtreeStore(shared< VirtualDev > vdev, std::vector< superblk< I
return (hnode.m_value->m_refcount.test_le(1));
})} {
m_bufalloc_token = BtreeNode::Allocator::add(BtreeNode::Allocator{
[](uint32_t size) { return new uint8_t[size]; }, // alloc_btree_node
[](BtreeNode* node) { delete[] uintptr_cast(node); }, // free_btree_node
[this](uint32_t node_size) -> uint8_t* { // alloc_node_buf
[](uint32_t size) { return new uint8_t[size]; }, // alloc_btree_node
[](BtreeNode* node) {
node->~BtreeNode();
delete[] uintptr_cast(node);
}, // free_btree_node
[this](uint32_t node_size) -> uint8_t* { // alloc_node_buf
return hs_utils::iobuf_alloc(node_size, sisl::buftag::btree_node, m_vdev->align_size());
},
[](uint8_t* buf) { hs_utils::iobuf_free(buf, sisl::buftag::btree_node); }});
Expand Down
Loading