* flush all segments in one thread sequentially
* bonus: move flush-related functions into dedicated file
* Minor comment tweaks
* await for flush on segment holder level
* fmt
* Minor improvement, preallocate vector for payload index flushers
* Remove invalid comment
---------
Co-authored-by: timvisee <tim@visee.me>
* Create and load for an appendable quantization
remove feature flag
more todo
review remarks
review remarks
* fix after rebase
* Enable BQ in appendable segments
* remove const placeholder
* fix after rebase
* fix after rebase
* fix config mismatch optimizer
* fix sq infinity loop
* add comment
* Create and load for an appendable quantization
remove feature flag
more todo
review remarks
review remarks
* fix after rebase
* Rename is_appendable to supports_appendable
---------
Co-authored-by: timvisee <tim@visee.me>
* Enable Gridstore payload index storage, rename storage types
* Respect payload_index_skip_mutable_rocksdb feature flag
* Minor cleanup
* Fix map payload index Gridstore semantics, only create files if desired
The semantics of backing storages in payload indices are inconsistent.
This aligns the Gridstore backing storage to our RocksDB backing
storage, matching the create/open/load behavior. Now, it will only
create Gridstore files on disk if we request it to do so.
This commit only implements it on the map index. In following comments
the same will be implemented in all other payload indices too.
* Apply same Gridstore semantics to other payload index types
* Rename create parameter to create_if_missing
* Fix bench compilation errors
* use sequential reads for building quantized vectors
* populate vector storages before indexing
* consistent naming
* Update lib/segment/src/fixtures/index_fixtures.rs
---------
Co-authored-by: Tim Visée <tim+github@visee.me>
* Migrate RocksDB based payload storage into Gridstore
* Add migrate_rocksdb_payload_storage feature flag
* Minor tweaks
* Use iter to migrate all payloads
* Fix clippy warning
* Update OpenAPI spec
* Track if mmap payload storage is populated, set memory/disk storage type
* Add test
* Log amount of bytes we migrate instead of point count
* Remove TODO
* Render storage size migrated in human human readable format, not bytes
* On migration failure, drop full payload storage directory
* Fix missing import
* Add in-ram-mmap payload storage type
* When RocksDB is not compiled, select in-ram mmap payload storage
* Enable payload storage on-disk check again in config mismatch optimizer
* Add feature flag to build in-ram-mmap payload storage
* Tweak is_on_disk condition
* Bump version estimates in runtime feature flags
* Fix not changing storage states, migrate vector storages in full segment
* Destroy old vector storage data after updating segment config
* Disable existing migrations, only use segment level ones
* Remove segment config update warnings
* Correctly bump sparse vector storage type
* Fix clippy warnings without RocksDB feature flag
* Use sparse vector storage fixture without RocksDB
* Fix some tests
* Replace RocksDB sparse storage with Gristore in mutable text index tests
* Use in-memory vector storage in multivector HNSW test
* Flag many more RocksDB specifics in tests
* Use database placeholder type without RocksDB flag
* Flag more tests
* Flag even more tests
* Fix imports, fix typo, and repair base test build
* Initialize dummy database if RocksDB flag is disabled
* Assert correct storage types
* Don't use old vector storage type when RocksDB is disabled
* Expos default for vector storage type only in tests
* Only expose simple segment constructor in tests
* Don't derive Default
* Fix inverted appendable flag
* Flag index selector
* Flag take_database_snapshot
* Flag field index builder
* Flag bool index
* Flag full text index
* Flag geo index
* Flag map index
* Feature flag numeric index
* Flag skip_rocksdb
* Flag payload storage
* Flag segment
* Flag builder
* Flag backup
* Make RocksDB crate optional
* Tweak feature flag gate
* Disable default segment crate features from all dependents
* Handle flag in collection crate correctly
* Flag payload storage types in tests
* Temporarily disable on-disk check for sparse vectors
* Flag sparse vector RocksDB in GPU code
* Fix compilation error since recent merge
* Flag payload storage types in new function
* remove todo
* Explicitly implement default to more clearly state difference
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* Reformat
* Add function to find appendable sparse storage files without opening it
* Actively migrate away from RocksDB based sparse vector storage
* Add test for simple sparse vector storage migration
* Fix test comments
* Also migrate vector deletes for sparse storage
* Use walkdir to list files
* Add function to open all multi dense vector storage types
* Move list files function into common crate
* Add function to find appendable multi dense storage files without opening it
* Actively migrate away from RocksDB based multi dense vector storage
* Add test for simple multi dense vector storage migration
* Also migrate vector deletes for multi dense storage
* Extend Gridstore blob trait, support basic primitives and vector of them
* Implement mutable numeric index on top of Gridstore
* Wrap Gridstore in rwlock, flush asynchronously
* Set custom Gridstore options tuned to numeric index
* Fix compilation errors
* Destruct RocksDB selector everywhere
* Add Gridstore payload index selector, build numeric, fallback others
* Add feature flag to Gridstore mutable payload index
* Don't store empty values in gridstore, it's not supported
* Reformat
* Initialize Gridstore during init of index builder
* Use owned and referenced paths correctly around Gridstore
* Change Gridstore page size in numeric index as suggested
* Make Gridstore block size dependent on size of numeric type
* Add tests
* Add separate fixed size blob trait for vec, prevent footgun
* Improve page size calculation
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
* Simplify Blob requirement for numeric payload index
* Add missing test cases
* Replace ref mut with &mut
* Use correct hardware counter
* Implement clear cache for numeric payload index on Gridstore
* The block size is dynamic
* Error if trying to load index from storage that doesn't match backend
* fix counter
* Add comment on why we change page size
---------
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
* Add function to open all appendable dense vector storage types
* Add function to find appendable dense storage files without opening it
* Add function to migrate RocksDB dense vector storage into mmap
* Add feature flag and actively migrate on load
* Log number of migrated points
* Add function to open all simple dense vector storage types
* Add test for simple dense vector storage migration
* Use correct column families
* Use more generic feature flag
* Also migrate vector deletes
* Fix review remarks
* Actively migrate RocksDB ID tracker to new format on segment load
* Extract ID tracker migration logic to function
* Feature flag ID tracker migration
* Simplify ID tracker migration by moving it deeper into load function
* Move migrate function to the bottom
* Add test to assert RocksDB to mutable ID tracker migration
* Assert new mutable ID tracker is empty
* Review remarks
* On RocksDB to mutable ID tracker migration failure, clean up files
* Demote empty mutable ID tracker to debug assertion
* Copy all point versions, including deleted, set known mappings
* read links and versions separatelly
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* Add no-rocksdb feature flag, disable dense vector storage using RocksDB
* Disable multi dense vector storage using RocksDB
* Feature flag now unused function arguments
* Invert no-rocksdb, use rocksdb and enable by default
* RocksDB is required in some benches
* Feature flag RocksDB based sparse vector storage
* Propagate rocksdb feature flag to root crate
* Feature flag stored point, only used in context of RocksDB
* Mention what disabling RocksDB feature does in Cargo.toml
* Make gridstore Advise::Random and add function for sequential read
* Reduce duplicate code in gridstore
* use sequential implementation in iterator
* actually use the sequential read
---------
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
* Pass FeatureFlags into VectorIndexBuildArgs
* Incremental HNSW index building: append-only case
* Use debug_assert
* first_few_ids
* Check deleted_point_count
* Drop unused method
* wip: implement explicit populate and clear_cache functions for all components
* fmt
* implement clear and populate for vector storages
* fmt
* implement clear and populate for payload storage
* wip: implement explicit populate and clear_cache functions payload indexes
* implement explicit populate and clear_cache functions payload indexes
* fix clippy on CI
* only compile posix_fadvise on linux
* only compile posix_fadvise on linux
* implement explicit populate and clear_cache functions for quantized vectors
* fmt
* remove post-load prefault
* fix typo
* implement is-on-disk for payload indexes, implement clear on drop for segment, implement clear after segment build
* fmt
* also evict quantized vectors after optimization
* re-use and replace advise_dontneed
* Rename mutable ID tracker mappings file
* Make new ID tracker the default, add new variant for RocksDB tracker
* In mutable ID tracker, only list files if they exist on disk
* Don't use the new mutable ID tracker yet
* Feature flag usage of new mutable ID tracker
* Simplify RocksDB check a bit
* Rename both the mutable ID tracker files
* create initial strucutres
* clippy
* start field-query refactoring
* start field-query refactoring (2/N)
* start field-query refactoring (3/N): duplicate is_empty/null condiftions as field condition
* start field-query refactoring (4/N): re-instate is_empty fallback in case new index is not built yet
* filter for is_empty/is_null
* implement add/remove point
* upd schema
* open and create of null-index
* create null-index
* fix test
* Update lib/segment/src/index/query_optimization/condition_converter.rs
Co-authored-by: Tim Visée <tim+github@visee.me>
* unit test for null-index
* more unit tests
* add openapi tests
* fmt
* fix for integartion tests
* rabbit review fix
* make [null] non-empty
---------
Co-authored-by: Tim Visée <tim+github@visee.me>
* Bump Rust edition to 2024
* gen is a reserved keyword now
* Remove ref mut on references
* Mark extern C as unsafe
* Wrap unsafe function bodies in unsafe block
* Geo hash implements Copy, don't reference but pass by value instead
* Replace secluded self import with parent
* Update execute_cluster_read_operation with new match semantics
* Fix lifetime issue
* Replace map_or with is_none_or
* set_var is unsafe now
* Reformat
* notify optimizers scheduler of the budget change
* Zero permit count when releasing CPU or IO
---------
Co-authored-by: Tim Visée <tim+github@visee.me>
* rename cpu_budget -> resource_budget
* clippy
* add io budget to resources
* fmt
* move budget structures into a separate file
* add extend permit function
* dont extend existing permit
* switch from IO to CPU permit
* do not release resource before aquiring an extension
* fmt
* Review remarks
* Improve resource permit number assertion
* Make resource permit replace_with only acquire extra needed permits
* Remove obsolete drop implementation
* allocate IO budget same as CPU
* review fixes
---------
Co-authored-by: timvisee <tim@visee.me>