From 97ab7ff2579cd1579ea2359aed1cb6cfa5bd9a68 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Sun, 25 Aug 2024 17:38:27 +0200 Subject: [PATCH 1/3] Apply get_storage_info.patch --- src/hnsw/hnsw_index.cpp | 8 ++++++-- src/include/hnsw/hnsw_index.hpp | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/hnsw/hnsw_index.cpp b/src/hnsw/hnsw_index.cpp index a4b4923..63108be 100644 --- a/src/hnsw/hnsw_index.cpp +++ b/src/hnsw/hnsw_index.cpp @@ -490,7 +490,7 @@ void HNSWIndex::PersistToDisk() { is_dirty = false; } -IndexStorageInfo HNSWIndex::GetStorageInfo(const bool get_buffers) { +IndexStorageInfo HNSWIndex::GetStorageInfo(const case_insensitive_map_t &options, const bool to_wal) { PersistToDisk(); @@ -498,7 +498,7 @@ IndexStorageInfo HNSWIndex::GetStorageInfo(const bool get_buffers) { info.name = name; info.root = root_block_ptr.Get(); - if (!get_buffers) { + if (!to_wal) { // use the partial block manager to serialize all allocator data auto &block_manager = table_io_manager.GetIndexBlockManager(); PartialBlockManager partial_block_manager(block_manager, PartialBlockType::FULL_CHECKPOINT); @@ -532,6 +532,10 @@ string HNSWIndex::VerifyAndToString(IndexLock &state, const bool only_verify) { throw NotImplementedException("HNSWIndex::VerifyAndToString() not implemented"); } +void HNSWIndex::VerifyAllocations(IndexLock &state) { + throw NotImplementedException("HNSWIndex::VerifyAllocations() not implemented"); +} + //------------------------------------------------------------------------------ // Register Index Type //------------------------------------------------------------------------------ diff --git a/src/include/hnsw/hnsw_index.hpp b/src/include/hnsw/hnsw_index.hpp index bd0a60d..82e527e 100644 --- a/src/include/hnsw/hnsw_index.hpp +++ b/src/include/hnsw/hnsw_index.hpp @@ -72,7 +72,7 @@ class HNSWIndex : public BoundIndex { //! Insert a chunk of entries into the index ErrorData Insert(IndexLock &lock, DataChunk &data, Vector &row_ids) override; - IndexStorageInfo GetStorageInfo(const bool get_buffers) override; + IndexStorageInfo GetStorageInfo(const case_insensitive_map_t &options, const bool to_wal) override; idx_t GetInMemorySize(IndexLock &state) override; //! Merge another index into this index. The lock obtained from InitializeLock must be held, and the other @@ -85,8 +85,10 @@ class HNSWIndex : public BoundIndex { //! Performs constraint checking for a chunk of input data void CheckConstraintsForChunk(DataChunk &input, ConflictManager &conflict_manager) override; - //! Returns the string representation of the HNSWIndex, or only traverses and verifies the index + //! Returns the string representation of the HNSWIndex, or only traverses and verifies the index. string VerifyAndToString(IndexLock &state, const bool only_verify) override; + //! Ensures that the node allocation counts match the node counts. + void VerifyAllocations(IndexLock &state) override; string GetConstraintViolationMessage(VerifyExistenceType verify_type, idx_t failed_index, DataChunk &input) override { From eefbd674b9d9d2bb153a361e89db0ee368f1094a Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Sun, 25 Aug 2024 17:42:47 +0200 Subject: [PATCH 2/3] Apply get_storage_info.patch --- src/hnsw/hnsw_index_physical_create.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hnsw/hnsw_index_physical_create.cpp b/src/hnsw/hnsw_index_physical_create.cpp index 07eb2da..1d2d63c 100644 --- a/src/hnsw/hnsw_index_physical_create.cpp +++ b/src/hnsw/hnsw_index_physical_create.cpp @@ -34,6 +34,9 @@ PhysicalCreateHNSWIndex::PhysicalCreateHNSWIndex(LogicalOperator &op, TableCatal //------------------------------------------------------------- class CreateHNSWIndexGlobalState final : public GlobalSinkState { public: + CreateHNSWIndexGlobalState(const PhysicalOperator &op_p) : op(op_p) {} + + const PhysicalOperator &op; //! Global index to be added to the table unique_ptr global_index; @@ -51,7 +54,7 @@ class CreateHNSWIndexGlobalState final : public GlobalSinkState { }; unique_ptr PhysicalCreateHNSWIndex::GetGlobalSinkState(ClientContext &context) const { - auto gstate = make_uniq(); + auto gstate = make_uniq(*this); vector data_types = {unbound_expressions[0]->return_type, LogicalType::ROW_TYPE}; gstate->collection = make_uniq(BufferManager::GetBufferManager(context), data_types); From cde430ca22464abaefa0a0147fa7627107fbd906 Mon Sep 17 00:00:00 2001 From: Carlo Piovesan Date: Sun, 25 Aug 2024 17:44:38 +0200 Subject: [PATCH 3/3] Bump submodules --- duckdb | 2 +- extension-ci-tools | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/duckdb b/duckdb index d8a69cc..19a3247 160000 --- a/duckdb +++ b/duckdb @@ -1 +1 @@ -Subproject commit d8a69cc6563f510a834a80e68d8afc9b81e6b2e3 +Subproject commit 19a32473166e0ad0d7472142a6f93872178c5fcf diff --git a/extension-ci-tools b/extension-ci-tools index da0b859..c924560 160000 --- a/extension-ci-tools +++ b/extension-ci-tools @@ -1 +1 @@ -Subproject commit da0b8597f5cdc3b899451d3ac1aa47eabfac4e07 +Subproject commit c9245601b70dba971b7d9a516c6a68fe5986ae00