Milvus Correctness Testing Framework
A testing framework specifically designed to verify data correctness in Milvus vector database under large-scale write operations. This framework supports processing billions of data entries and provides reliable verification mechanisms.
Key Features
- Support for large-scale data processing (1B+ entries)
- Real workload simulation based on Markov chains
- Efficient disk storage backend (RocksDB/LMDB)
- Batch processing optimization
- Configurable sampling verification
- Detailed progress tracking and statistics
System Requirements
- Python >= 3.10
- Milvus >= 2.5.0
- PDM (Python package manager)
- Sufficient disk space for storing request queues and state data
Project Structure
src/milvus_correctness/
├── core/ # Core framework components
│ ├── framework.py # Main framework coordination
│ ├── milvus_client.py # Enhanced Milvus client wrapper
│ └── models.py # Data models and configurations
├── calculators/ # State calculation and verification
├── generators/ # Request generation components
├── processors/ # Request processing components
├── storage/ # Storage backend implementations
└── utils/ # Utility functions
Installation
# Install dependencies using PDM
pdm install
Quick Start
-
Ensure Milvus service is running and test collection is created
-
Run example test:
pdm run examples/small_scale_test.py
Framework Components
1. Core Framework (core/)
CorrectnessFramework: Main coordination classMilvusClientWrapper: Enhanced Milvus client with auto-reconnection- Configuration models and data structures
2. Request Generator (generators/)
- Markov chain-based operation sequence generation
- Probabilistic primary key selection
- Configurable operation distributions
- Efficient PK tracking with Bloom filters
3. Request Processor (processors/)
- Batch processing optimization
- Automatic retry mechanism
- Concurrent request handling
- Progress tracking and statistics
4. State Calculator (calculators/)
- Disk-based state tracking
- Stream processing of success logs
- Sampling-based verification
- Detailed consistency checks
5. Storage Backend (storage/)
- Persistent queue implementation
- State storage interface
Configuration Example
from milvus_correctness.core.models import (
GeneratorConfig,
MilvusConfig,
StorageConfig
)
# Milvus configuration
milvus_config = MilvusConfig(
host="localhost",
port=19530,
collection_name="test_collection"
)
# Generator configuration
generator_config = GeneratorConfig(
op_states=["INSERT", "UPSERT", "DELETE"],
transition_matrix={
"INSERT": {"INSERT": 0.7, "UPSERT": 0.2, "DELETE": 0.1},
"UPSERT": {"INSERT": 0.3, "UPSERT": 0.6, "DELETE": 0.1},
"DELETE": {"INSERT": 0.6, "UPSERT": 0.3, "DELETE": 0.1}
},
pk_field_name="id",
vector_field_name="vector",
vector_dim=128,
data_schema={
"metadata": "str"
}
)
# Storage configuration
storage_config = StorageConfig(
request_queue_path="data/request_queue",
success_log_path="data/success_log",
storage_type="rocksdb",
clear_on_start=True
)
Usage Example
from milvus_correctness.core.framework import CorrectnessFramework
# Initialize framework
framework = CorrectnessFramework(
milvus_config=milvus_config,
generator_config=generator_config,
storage_config=storage_config,
batch_size=1000,
max_retries=3
)
# Generate requests
framework.generate_requests(1_000_000)
# Process requests
framework.process_requests()
# Calculate and verify state
framework.calculate_expected_state()
is_consistent, stats = framework.verify_state(sample_size=10000)
# Get statistics
print(framework.get_statistics())
# Cleanup resources
framework.cleanup()
Contributing
Issues and Pull Requests are welcome!
License
MIT License
Metadata
Release files for milvus-correctness 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| milvus_correctness-0.1.0.tar.gz | 18.0 kB | Without provenance | Details for milvus_correctness-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| milvus_correctness-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for milvus_correctness-0.1.0-py3-none-any.whl |
Total release size: 39.4 kB
Release files / milvus_correctness-0.1.0.tar.gz
| Download URL | milvus_correctness-0.1.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10006b3d4ce27f5ffbca0c0af67e33c0facf5d87f17dc80309201d9b11b58f8b
|
|
BLAKE2b-256 checksum How to use checksums |
41d4391d1a62edd2d9615ba76b37f8e8c00b9d3312236c0a720b6a346fbda734
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.3 CPython/3.13.2 Darwin/22.6.0
|
Release files / milvus_correctness-0.1.0-py3-none-any.whl
| Download URL | milvus_correctness-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3679c146c8c89011c96eafcca05b52ac6c1e955998c143b9c22252db05ca375f
|
|
BLAKE2b-256 checksum How to use checksums |
e1d556c8be65e641f402e50289925d669ad3130ab1812e0928a79d18815c2582
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.3 CPython/3.13.2 Darwin/22.6.0
|
Security for milvus-correctness 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.