Repository navigation
Conversation
|
Actually, Antonio, while you're at it - instead of this fix, please just remove the entire benchmark folder, it was some experiment that got committed by accident and I forgot to delete it. |
|
Don't we need to run benchmarks? |
|
We do, but these are not actual useful benchmarks. |
|
My benchmarks aren't automated, I'm running them manually. It's a good idea to automate them actually. |
|
I have added some fixes to the Makefiles. |
|
that's on purpose, tests are not running inside a redis module! |
|
So far if you run |
|
I'm seeing too many failures on Travis. I don't think it's related but I'm waiting until I finish the current branch I'm working on, and then I'll merge this and stabilize the builds. |
[add] added IF {condition} to FT.ADD API
* delete deps/ disk/ tests/ and redisearch_module.c * add initial crate & CMakeLists.txt * modify root CMakeLists.txt to build rust static lib * change workflow to just build * add dummy file, turn shared on, add CMAKE_ARGS * revert .gitignore to main + cargo * remove testing_symbols * remove deps & tests from gitignore, remove dummy file * remove c++ deps & add comment on shared=ON * add error message * Give CMAKE_ARGS a default to make CI happy * Remove redisearch specifics from .gitignore * Don't build redisearch as shared lib * Build as `oss` type * Update submodules to use ssh * Update comment on shared build config * add clippy lint task * testing rebuild? * Minimal Rust to get the server starting * Update redisearch deps * Open index * Impl close * Close index spec * Move into modules * Touchups * impl IndexSpec * put and index minimal, IndexSpec::insert_document, helpers * add IndexSpec::index_document * Impl needed code for term iterator * Correctly get the document keys * Respect updated documents * Add tests for index spec * Add `impl Into<Key>` for inserting documents * Extract inverted index values into posting list struct * Tests for posting list This also removes the lifetime on the wrapping iterator since we can use `'static` for now. * Simplify into query iterator * Rename to postings list * small cleanup * Simplify search disk * Comments and renamings * add unsafe comments * number references to safety comments * Improve comment * Only use `dev` profile in DEBUG mode * Remove unused function * Rename function clashing with `Iterator::next` This just avoids confusion with the iterator function calls. * Fix document list indentation * Use CMake's default casing * Explicitly set release builds * move some structs into separate files * make casting consistent * initial commit * use explicit cast * Update redisearch submodule * Document static lifetime * Use an inverted index structure * use unwrap instead of expect * clippy * comments + as_mut_unchecked generic lifetime * add documentation to dmd members * add test workflow, fix doc metadata tests * make test workflow smaller since only cargo runs * typo * add field mask field * add field mask in term_iterator + tests * nits * use newer disk api and align the extern c functions in lib.rs * small fixes * use expect * align to previous error * add doc comments to IndexEntry, and test doc ids * add a `cargo fmt check` to the lint workflow * typo, test color again * use --color= * hack so colors are shown * add comment explaining hack * format code * MOD-12397: Rust - Add Support To Track Deleted Document IDs (#19) * initial commit * code review fixes * code review comments * remove unused functions * update cargo lock * add test for deleting documents, try and fix lint issue * format the code * Fix intend in CI merge to queue event (#24) * MOD-12398: Store DocumentType inside IndexSpec (#27) * initial commit * code review comments * Remove broken pull request flow (#28) * Restore pull request flow * Just remove the broken file instead * [MOD-12405] Use the iterator from the OSS (#16) * Use the iterator from the OSS This makes the wrapping iterator generic to allow us to use any of the OSS iterators. This means also implementing the `IndexReader` for the postings list. * Remove need for loop Co-authored-by: Enrico Borba <[email protected]> * Idiomatic Rust index access Co-authored-by: Enrico Borba <[email protected]> * Use cast() instead * Add missing documentation * Don't set out of bounds index positions * Make sure `postings_block_index` is not out of bounds * Remove unneeded methods * Reuse the wrapper from OSS We no longer need our own implementation of this. * Don't allow backwards skips * Add comment for index fields * Unwrap last entry instead * Another last entry unwrap * Better variable name * More better names Co-authored-by: kei-nan <[email protected]> * Update redisearch submodule --------- Co-authored-by: Enrico Borba <[email protected]> Co-authored-by: kei-nan <[email protected]> * [MOD-12413] speedb database creation (#26) * WIP db impl * add constant * add tests * add basic tests, and multi-threaded docs * add doc_type * Fix warnings in `inverted_index` integration test module (#30) * [MOD-12445] Serialize and deserialize the DB types (#22) * Serialize and deserialize document metatdata * Serialize and deserialize a full term block * Add versioning support * Add safety comment * Update comments * Fix version and count comment Co-authored-by: Copilot <[email protected]> * Fix test function name Co-authored-by: Copilot <[email protected]> * Change safety to panic comments Co-authored-by: Copilot <[email protected]> * Convert unsafe from_bytes function * Lazy read DMD data * Convert another unsafe function to panic instead * Use alias for metadata bytes * Use `size_of` Co-authored-by: Enrico Borba <[email protected]> * Remove obvious comments * Change return type to `t_docId` * Prevent integer overflows * Use constant for latest version * Use a constant for `FullTerm` size * Use `u8` to track number of terms * Pass down `frequency` * Use size constant in more places * BASE_OFFSET constant & num_entries type fixes * Restore test * Remove hardcoded offsets * Split doc IDs from metadata in storage * Lint issues * Fix comments about bound checking Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Enrico Borba <[email protected]> * Respect weight when searching (#29) Pass weight to the virtual RSIndexResult in `InvertedIndex::term_iterator` Signed-off-by: Henk Oordt <[email protected]> * Make wildcard iterator (#32) * [MOD-12396] Make a new type for document ID key (#25) * Make a new type for document ID key This allows us to use document IDs as keys in speedb where they will need to be sortable lexicographically. * Make padding width a constant Co-authored-by: Enrico Borba <[email protected]> * Make the inner doc ID private --------- Co-authored-by: Enrico Borba <[email protected]> * Fix wildcard compile issue (#34) * Directly use Rust port of DocumentType from RediSearch (#33) Change type of `doc_table::DocTable` from `ffi::DocumentType` to `document::DocumentType`. Update other code affected by this change. As `document::DocumentType` does not implement `Default`, we provide a manual implementation of `Default` for `DocTable`, replacing the derived implementation. Signed-off-by: Henk Oordt <[email protected]> * [MOD-12709] make unique docs return u64 for IndexReader (#36) * make unique docs return u64 * align with RediSearch master * properly align RediSearch * MOD-12892: Open Index Spec Columns Upon IndexSpec Creation (#37) * open index spec columns when opening an index * code review fixes * [MOD-12411] Doc table in speedb (#38) * Pass the database down to `DocTable` * Pass cf_name to doc table * Store in speedb * Make new type for speedb database handle This just makes it easier to share around the code. * Simplify * Easier column family handle management * Easier key management * Propagate speedb errors * Make it easier to get the doc id from a speedb key * Improve comments * Lint fixes * Simple iterator * More lint issues * Hook up to search on disk database * Better trait name * Missing comment * Use is deleted check instead * Add comment about cf handle not being stored * add more unittests to document_metadata (#42) * add more unittests to document_metadata * remove useless tests * apply code suggestion changes * MOD-12832: Add Integration Test Framework Using RLTest (#39) * initial commit * use python file to run tests * remove old runtests.sh file * usd bdd approach * some additional fixes * additional fixes * enable flex option in redis-server * support providing library path * support rust backtraces, try and fix panic when opening database * fixes * code review fixes * run each test in its own folder to allow test parallelism * provide the redis-lib-path * add caching support * compilation fix * try and find bs_speedb.so * fix python package installation * init submodules * fix python installation flow * fix sccache write errors * try and fix sccache * additional fixes * fix test * split caching to multiple steps * remove semicolon * try and fix caching, also use newer bdd * fix lint issue * change key to be based on redis sha1 commit id * use release mode * need to use sudo when restoring from cache into system folders * change caching key, use repo variable for runs-on * use debug in CI, support profile in build.sh * code review fixes * code review comments * add wildcard featur testing * code review comment * support running tests in parallel * add more unittests to document_id_key (#41) * add more unittests to document_id_key * remove useless tests * Apply suggestions from code review Co-authored-by: Pieter <[email protected]> * fix more comments --------- Co-authored-by: Pieter <[email protected]> * [MOD-12987] Make inverted_index module with full_term_block privately in it (#47) * move full term block as private in inverted index * undo change * create an inverted index submodule with full term block private in it * Update redisearch_disk/src/index_spec/inverted_index/mod.rs Co-authored-by: Pieter <[email protected]> --------- Co-authored-by: Pieter <[email protected]> * [MOD-13005] Make doc_table module with document_metadata privately in it (#49) * move full term block as private in inverted index * undo change * create an inverted index submodule with full term block private in it * create a doc_table submodule with document metadata private in it * Update redisearch_disk/src/index_spec/inverted_index/mod.rs Co-authored-by: Pieter <[email protected]> * Update redisearch_disk/src/index_spec/doc_table/mod.rs Co-authored-by: Pieter <[email protected]> --------- Co-authored-by: Pieter <[email protected]> * Fix IsDeleted Logic In FFI (#51) * try and stablize ci * capture redis info at end of test * info everything * use resp3 to try and get potential warnings * remove caching * try and fix tests * revert caching removal * remove miri section * revert task-test.yml * remove redundant code * refactor document id key removing storage module (#50) * move full term block as private in inverted index * undo change * create an inverted index submodule with full term block private in it * create a doc_table submodule with document metadata private in it * refactor document id key removing storage module * MOD-12970: Run Unit Tests with Miri in CI (#48) * initial commit * use a seperate runner for miri * try without submodules * generate github token * Update .github/workflows/task-test.yml apply code review comment Co-authored-by: Itzikvaknin <[email protected]> * fix code review comment, separate flows into different files, have a pr-validation step * remove miri section * update miri yml task --------- Co-authored-by: Itzikvaknin <[email protected]> * add rusttoolchain to align rust version with redisearch (#56) * add rusttoolchain to align rust version with redisearch * add clippy install to linting * [MOD-12410] Implement merge function (#44) Rename `src/index_spec.rs` to `src/index_spec/mod.rs` for consistency Clean up `PostingsListBlock` - Introduce docs constants and const functions to clarify the layout of a block, and the way offsets are calculated to which data is written in a block in `PostingsListBlock::push` Define and implement `PostingsListBlockBuilder` - Repeatedly calling `PostingsListBlock::push` introduces unneeded shifting operations. `PostingsListBlockBuilder` allows for efficiently creating a `PostingsListBlock` from scratch Implement `DeletedIdsStore` - To allow for shared and synchronized access to deleted ids, implement a store for deleted IDs and replace instances of `DeletedIds` with it. Implement merge operator - Implement `DeletedIdsMergeOperator` and register it using `speedb::Options::set_merge_operator` Address review comments - Replace `DeletedIds::into_store` with `DeletedIdsStore::new()` and `DeletedIdsStore::with_deleted_ids` - Introduce `ArchivedFillTermBlock::iter` to iterate over documents in the block, and use it in `DeletedIdsMergeOperator::full_merge_inner::push_from_archived_block` to clean up the loop. - Document closure created in `DeletedIdsMergeOperator::full_merge_inner` - Assert existing block's last doc ID is greater than that of any of the operands and specify the function's invariants in `DeleteIdsMergeOperator::full_merge_inner` - Fix incorrect tests in `merge_op` - Remove `PostingsListBlock::MAX_NUM_TERMS` and `PostingsListBlock::is_full` as they're not enforceable. * [MOD-12412] Inverted index in speedb (#45) * Pass database down to inverted index * Pass down inverted index cf name * Switch to speedb * Make key management easier * Fix lint issues * More safety * Touch ups * Don't delete the temp dir until the tests are done * Remove name from key * Prevent cloning term by borrowing * Zero padd last doc id * Propagate insert errors * Lint issues * Add documentation * Log insert error * Skip inverted index (now on speedb) tests for Miri * Update todo comment * Handle empty blocks after merge * Panic on error for now We can handle this better later. * Don't silently fail on overflow * Return `None` on error in `DeleterIdsMergeOperator::full_merge_inner` (#58) Instead of panicking when detecting a data corruption, return `None`, which is the correct way to signal speedb the data is incorrect. Similarly, return an empty block instead of None if the merge result contains no documents. * MOD-12959: Handle Errors In FFI Layer Without Panicing (#57) * try and avoid expect and panics in lib.rs * fix lint * code review fixes * code review fixes - remove tests since they can't easily compile * code review comments * [MOD-13065] Docement why `u8` is safe for num_terms (#59) * Docement why `u8` is safe for num_terms * Improve comment Co-authored-by: kei-nan <[email protected]> --------- Co-authored-by: kei-nan <[email protected]> * Update redisearch submodule and use new tracing (#60) * Update redisearch submodule and use new tracing * Link static libraries * Build module in miri tests * MOD-12976: Make DocTable Threadsafe (#52) * initial commit - make document id atomic, recover last document id on doc table creation * Apply suggestions from code review apply suggestions Co-authored-by: Copilot <[email protected]> * make doc table threadsafe, no mut refrences * code review comments * remove path * rename inverted index module file and move it * code review comments --------- Co-authored-by: Copilot <[email protected]> * [MOD-12834] add benchmark CI (#53) * add benchmark CI yamls * add benchmark case * list of repos with permission update * have benchmark flow use proper paths * Update .github/workflows/benchmark-flow.yml * add rusttoolchain to align rust version with redisearch * fix redis path * add comments in files * change some wording * MOD-12833: CI Add Microbenchmark Support (#54) * add microbenchmarks * point microbenchmarks to correct branch * code review fixes * code review fix * allow build.sh to run benchmarks * return to parent folder * rebase fix * make running benchmarks conditional on label * code review fixes * change label * fix fomratting * modify the logic * code review fixes * various fixes * run benchmark comparison on nightly * add required permissions * code review fixes * run all microbenchmarks * update documentation * bring back --check * fixes * code review comments * run specific microbenchmarks * code review fixes * make benchmark tasks more modularized to remove code duplication * code review fixes * code review fixes * code review fixes * code review comment - run all benchmarks * code review comments * try and fix benchmark flow * only run benchmarks * disable library benchmarking * finish rename * [RED-172954] add unittest for document_id_key [from to key] (#61) * add unittest for document_id_key * format fix * [MOD-12977] Use lazy iterators (#46) * Use a lazy iterator over the inverted index * More tests * Better comments * Missing test case * Better variable name * Lint issue * Don't iterate into similar prefixes * Also use lazy (wildcard) iterator for doc table * Propagate read error * Optimize skip_to * Avoid binary search if next term matches * Optimize binary search from current location * Simplify * Address lint issue * Better end key match * Be explicit about errors * Document prefix match logic * Use alias * Panic on overflow * Extract delimeter into constant * Handle failed iterator on FFI * Use associate function instead * Log the document id of the last read block This is to help in the cases of debugging reading errors. * Reset index on errors * Make lazy reader over document table * Lint error --------- Signed-off-by: Henk Oordt <[email protected]> Co-authored-by: Enrico Zandomeni Borba <[email protected]> Co-authored-by: chesedo <[email protected]> Co-authored-by: Enrico Borba <[email protected]> Co-authored-by: Henk Oordt <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Joan Fontanals <[email protected]> Co-authored-by: Itzikvaknin <[email protected]>
…lock::ArchivedBlock (#63) * delete deps/ disk/ tests/ and redisearch_module.c * add initial crate & CMakeLists.txt * modify root CMakeLists.txt to build rust static lib * change workflow to just build * add dummy file, turn shared on, add CMAKE_ARGS * revert .gitignore to main + cargo * remove testing_symbols * remove deps & tests from gitignore, remove dummy file * remove c++ deps & add comment on shared=ON * add error message * Give CMAKE_ARGS a default to make CI happy * Remove redisearch specifics from .gitignore * Don't build redisearch as shared lib * Build as `oss` type * Update submodules to use ssh * Update comment on shared build config * add clippy lint task * testing rebuild? * Minimal Rust to get the server starting * Update redisearch deps * Open index * Impl close * Close index spec * Move into modules * Touchups * impl IndexSpec * put and index minimal, IndexSpec::insert_document, helpers * add IndexSpec::index_document * Impl needed code for term iterator * Correctly get the document keys * Respect updated documents * Add tests for index spec * Add `impl Into<Key>` for inserting documents * Extract inverted index values into posting list struct * Tests for posting list This also removes the lifetime on the wrapping iterator since we can use `'static` for now. * Simplify into query iterator * Rename to postings list * small cleanup * Simplify search disk * Comments and renamings * add unsafe comments * number references to safety comments * Improve comment * Only use `dev` profile in DEBUG mode * Remove unused function * Rename function clashing with `Iterator::next` This just avoids confusion with the iterator function calls. * Fix document list indentation * Use CMake's default casing * Explicitly set release builds * move some structs into separate files * make casting consistent * initial commit * use explicit cast * Update redisearch submodule * Document static lifetime * Use an inverted index structure * use unwrap instead of expect * clippy * comments + as_mut_unchecked generic lifetime * add documentation to dmd members * add test workflow, fix doc metadata tests * make test workflow smaller since only cargo runs * typo * add field mask field * add field mask in term_iterator + tests * nits * use newer disk api and align the extern c functions in lib.rs * small fixes * use expect * align to previous error * add doc comments to IndexEntry, and test doc ids * add a `cargo fmt check` to the lint workflow * typo, test color again * use --color= * hack so colors are shown * add comment explaining hack * format code * MOD-12397: Rust - Add Support To Track Deleted Document IDs (#19) * initial commit * code review fixes * code review comments * remove unused functions * update cargo lock * add test for deleting documents, try and fix lint issue * format the code * Fix intend in CI merge to queue event (#24) * MOD-12398: Store DocumentType inside IndexSpec (#27) * initial commit * code review comments * Remove broken pull request flow (#28) * Restore pull request flow * Just remove the broken file instead * [MOD-12405] Use the iterator from the OSS (#16) * Use the iterator from the OSS This makes the wrapping iterator generic to allow us to use any of the OSS iterators. This means also implementing the `IndexReader` for the postings list. * Remove need for loop Co-authored-by: Enrico Borba <[email protected]> * Idiomatic Rust index access Co-authored-by: Enrico Borba <[email protected]> * Use cast() instead * Add missing documentation * Don't set out of bounds index positions * Make sure `postings_block_index` is not out of bounds * Remove unneeded methods * Reuse the wrapper from OSS We no longer need our own implementation of this. * Don't allow backwards skips * Add comment for index fields * Unwrap last entry instead * Another last entry unwrap * Better variable name * More better names Co-authored-by: kei-nan <[email protected]> * Update redisearch submodule --------- Co-authored-by: Enrico Borba <[email protected]> Co-authored-by: kei-nan <[email protected]> * [MOD-12413] speedb database creation (#26) * WIP db impl * add constant * add tests * add basic tests, and multi-threaded docs * add doc_type * Fix warnings in `inverted_index` integration test module (#30) * [MOD-12445] Serialize and deserialize the DB types (#22) * Serialize and deserialize document metatdata * Serialize and deserialize a full term block * Add versioning support * Add safety comment * Update comments * Fix version and count comment Co-authored-by: Copilot <[email protected]> * Fix test function name Co-authored-by: Copilot <[email protected]> * Change safety to panic comments Co-authored-by: Copilot <[email protected]> * Convert unsafe from_bytes function * Lazy read DMD data * Convert another unsafe function to panic instead * Use alias for metadata bytes * Use `size_of` Co-authored-by: Enrico Borba <[email protected]> * Remove obvious comments * Change return type to `t_docId` * Prevent integer overflows * Use constant for latest version * Use a constant for `FullTerm` size * Use `u8` to track number of terms * Pass down `frequency` * Use size constant in more places * BASE_OFFSET constant & num_entries type fixes * Restore test * Remove hardcoded offsets * Split doc IDs from metadata in storage * Lint issues * Fix comments about bound checking Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Enrico Borba <[email protected]> * Respect weight when searching (#29) Pass weight to the virtual RSIndexResult in `InvertedIndex::term_iterator` Signed-off-by: Henk Oordt <[email protected]> * Make wildcard iterator (#32) * [MOD-12396] Make a new type for document ID key (#25) * Make a new type for document ID key This allows us to use document IDs as keys in speedb where they will need to be sortable lexicographically. * Make padding width a constant Co-authored-by: Enrico Borba <[email protected]> * Make the inner doc ID private --------- Co-authored-by: Enrico Borba <[email protected]> * Fix wildcard compile issue (#34) * Directly use Rust port of DocumentType from RediSearch (#33) Change type of `doc_table::DocTable` from `ffi::DocumentType` to `document::DocumentType`. Update other code affected by this change. As `document::DocumentType` does not implement `Default`, we provide a manual implementation of `Default` for `DocTable`, replacing the derived implementation. Signed-off-by: Henk Oordt <[email protected]> * [MOD-12709] make unique docs return u64 for IndexReader (#36) * make unique docs return u64 * align with RediSearch master * properly align RediSearch * MOD-12892: Open Index Spec Columns Upon IndexSpec Creation (#37) * open index spec columns when opening an index * code review fixes * [MOD-12411] Doc table in speedb (#38) * Pass the database down to `DocTable` * Pass cf_name to doc table * Store in speedb * Make new type for speedb database handle This just makes it easier to share around the code. * Simplify * Easier column family handle management * Easier key management * Propagate speedb errors * Make it easier to get the doc id from a speedb key * Improve comments * Lint fixes * Simple iterator * More lint issues * Hook up to search on disk database * Better trait name * Missing comment * Use is deleted check instead * Add comment about cf handle not being stored * add more unittests to document_metadata (#42) * add more unittests to document_metadata * remove useless tests * apply code suggestion changes * MOD-12832: Add Integration Test Framework Using RLTest (#39) * initial commit * use python file to run tests * remove old runtests.sh file * usd bdd approach * some additional fixes * additional fixes * enable flex option in redis-server * support providing library path * support rust backtraces, try and fix panic when opening database * fixes * code review fixes * run each test in its own folder to allow test parallelism * provide the redis-lib-path * add caching support * compilation fix * try and find bs_speedb.so * fix python package installation * init submodules * fix python installation flow * fix sccache write errors * try and fix sccache * additional fixes * fix test * split caching to multiple steps * remove semicolon * try and fix caching, also use newer bdd * fix lint issue * change key to be based on redis sha1 commit id * use release mode * need to use sudo when restoring from cache into system folders * change caching key, use repo variable for runs-on * use debug in CI, support profile in build.sh * code review fixes * code review comments * add wildcard featur testing * code review comment * support running tests in parallel * add more unittests to document_id_key (#41) * add more unittests to document_id_key * remove useless tests * Apply suggestions from code review Co-authored-by: Pieter <[email protected]> * fix more comments --------- Co-authored-by: Pieter <[email protected]> * [MOD-12987] Make inverted_index module with full_term_block privately in it (#47) * move full term block as private in inverted index * undo change * create an inverted index submodule with full term block private in it * Update redisearch_disk/src/index_spec/inverted_index/mod.rs Co-authored-by: Pieter <[email protected]> --------- Co-authored-by: Pieter <[email protected]> * [MOD-13005] Make doc_table module with document_metadata privately in it (#49) * move full term block as private in inverted index * undo change * create an inverted index submodule with full term block private in it * create a doc_table submodule with document metadata private in it * Update redisearch_disk/src/index_spec/inverted_index/mod.rs Co-authored-by: Pieter <[email protected]> * Update redisearch_disk/src/index_spec/doc_table/mod.rs Co-authored-by: Pieter <[email protected]> --------- Co-authored-by: Pieter <[email protected]> * Fix IsDeleted Logic In FFI (#51) * try and stablize ci * capture redis info at end of test * info everything * use resp3 to try and get potential warnings * remove caching * try and fix tests * revert caching removal * remove miri section * revert task-test.yml * remove redundant code * refactor document id key removing storage module (#50) * move full term block as private in inverted index * undo change * create an inverted index submodule with full term block private in it * create a doc_table submodule with document metadata private in it * refactor document id key removing storage module * MOD-12970: Run Unit Tests with Miri in CI (#48) * initial commit * use a seperate runner for miri * try without submodules * generate github token * Update .github/workflows/task-test.yml apply code review comment Co-authored-by: Itzikvaknin <[email protected]> * fix code review comment, separate flows into different files, have a pr-validation step * remove miri section * update miri yml task --------- Co-authored-by: Itzikvaknin <[email protected]> * add rusttoolchain to align rust version with redisearch (#56) * add rusttoolchain to align rust version with redisearch * add clippy install to linting * [MOD-12410] Implement merge function (#44) Rename `src/index_spec.rs` to `src/index_spec/mod.rs` for consistency Clean up `PostingsListBlock` - Introduce docs constants and const functions to clarify the layout of a block, and the way offsets are calculated to which data is written in a block in `PostingsListBlock::push` Define and implement `PostingsListBlockBuilder` - Repeatedly calling `PostingsListBlock::push` introduces unneeded shifting operations. `PostingsListBlockBuilder` allows for efficiently creating a `PostingsListBlock` from scratch Implement `DeletedIdsStore` - To allow for shared and synchronized access to deleted ids, implement a store for deleted IDs and replace instances of `DeletedIds` with it. Implement merge operator - Implement `DeletedIdsMergeOperator` and register it using `speedb::Options::set_merge_operator` Address review comments - Replace `DeletedIds::into_store` with `DeletedIdsStore::new()` and `DeletedIdsStore::with_deleted_ids` - Introduce `ArchivedFillTermBlock::iter` to iterate over documents in the block, and use it in `DeletedIdsMergeOperator::full_merge_inner::push_from_archived_block` to clean up the loop. - Document closure created in `DeletedIdsMergeOperator::full_merge_inner` - Assert existing block's last doc ID is greater than that of any of the operands and specify the function's invariants in `DeleteIdsMergeOperator::full_merge_inner` - Fix incorrect tests in `merge_op` - Remove `PostingsListBlock::MAX_NUM_TERMS` and `PostingsListBlock::is_full` as they're not enforceable. * [MOD-12412] Inverted index in speedb (#45) * Pass database down to inverted index * Pass down inverted index cf name * Switch to speedb * Make key management easier * Fix lint issues * More safety * Touch ups * Don't delete the temp dir until the tests are done * Remove name from key * Prevent cloning term by borrowing * Zero padd last doc id * Propagate insert errors * Lint issues * Add documentation * Log insert error * Skip inverted index (now on speedb) tests for Miri * Update todo comment * Handle empty blocks after merge * Panic on error for now We can handle this better later. * Don't silently fail on overflow * Return `None` on error in `DeleterIdsMergeOperator::full_merge_inner` (#58) Instead of panicking when detecting a data corruption, return `None`, which is the correct way to signal speedb the data is incorrect. Similarly, return an empty block instead of None if the merge result contains no documents. * MOD-12959: Handle Errors In FFI Layer Without Panicing (#57) * try and avoid expect and panics in lib.rs * fix lint * code review fixes * code review fixes - remove tests since they can't easily compile * code review comments * [MOD-13065] Docement why `u8` is safe for num_terms (#59) * Docement why `u8` is safe for num_terms * Improve comment Co-authored-by: kei-nan <[email protected]> --------- Co-authored-by: kei-nan <[email protected]> * Update redisearch submodule and use new tracing (#60) * Update redisearch submodule and use new tracing * Link static libraries * Build module in miri tests * MOD-12976: Make DocTable Threadsafe (#52) * initial commit - make document id atomic, recover last document id on doc table creation * Apply suggestions from code review apply suggestions Co-authored-by: Copilot <[email protected]> * make doc table threadsafe, no mut refrences * code review comments * remove path * rename inverted index module file and move it * code review comments --------- Co-authored-by: Copilot <[email protected]> * [MOD-12834] add benchmark CI (#53) * add benchmark CI yamls * add benchmark case * list of repos with permission update * have benchmark flow use proper paths * Update .github/workflows/benchmark-flow.yml * add rusttoolchain to align rust version with redisearch * fix redis path * add comments in files * change some wording * MOD-12833: CI Add Microbenchmark Support (#54) * add microbenchmarks * point microbenchmarks to correct branch * code review fixes * code review fix * allow build.sh to run benchmarks * return to parent folder * rebase fix * make running benchmarks conditional on label * code review fixes * change label * fix fomratting * modify the logic * code review fixes * various fixes * run benchmark comparison on nightly * add required permissions * code review fixes * run all microbenchmarks * update documentation * bring back --check * fixes * code review comments * run specific microbenchmarks * code review fixes * make benchmark tasks more modularized to remove code duplication * code review fixes * code review fixes * code review fixes * code review comment - run all benchmarks * code review comments * try and fix benchmark flow * only run benchmarks * disable library benchmarking * finish rename * [RED-172954] add unittest for document_id_key [from to key] (#61) * add unittest for document_id_key * format fix * [MOD-12977] Use lazy iterators (#46) * Use a lazy iterator over the inverted index * More tests * Better comments * Missing test case * Better variable name * Lint issue * Don't iterate into similar prefixes * Also use lazy (wildcard) iterator for doc table * Propagate read error * Optimize skip_to * Avoid binary search if next term matches * Optimize binary search from current location * Simplify * Address lint issue * Better end key match * Be explicit about errors * Document prefix match logic * Use alias * Panic on overflow * Extract delimeter into constant * Handle failed iterator on FFI * Use associate function instead * Log the document id of the last read block This is to help in the cases of debugging reading errors. * Reset index on errors * Make lazy reader over document table * Lint error * renaming full term document * add term module * other iteration of refactor * end refactor * fix lint * small improv * changes as per review --------- Signed-off-by: Henk Oordt <[email protected]> Co-authored-by: Enrico Zandomeni Borba <[email protected]> Co-authored-by: chesedo <[email protected]> Co-authored-by: jonathan keinan <[email protected]> Co-authored-by: Enrico Borba <[email protected]> Co-authored-by: Henk Oordt <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Itzikvaknin <[email protected]>
…new_deletion Add hnsw with new deletion
When compiling on MacOS I get a linking error.
ld: library not found for -lcrt0.oThis is a common MacOS issue for static linking: Link1, Link2