Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH]: add manual compaction method to frontend #3813

Draft
wants to merge 1 commit into
base: feat-in-memory-frontend
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ k8s_resource('sysdb', resource_deps=['sysdb-migration-sysdb-migration'], labels=
k8s_resource('frontend-service', resource_deps=['sysdb', 'logservice'],labels=["chroma"], port_forwards='8000:8000')
k8s_resource('rust-frontend-service', resource_deps=['sysdb', 'logservice'], labels=["chroma"], port_forwards='3000:8000')
k8s_resource('query-service', resource_deps=['sysdb'], labels=["chroma"], port_forwards='50053:50051')
k8s_resource('compaction-service', resource_deps=['sysdb'], labels=["chroma"])
k8s_resource('compaction-service', resource_deps=['sysdb'], labels=["chroma"], port_forwards='50054:50051')
k8s_resource('jaeger', resource_deps=['k8s_setup'], labels=["observability"])
k8s_resource('grafana', resource_deps=['k8s_setup'], labels=["observability"])
k8s_resource('prometheus', resource_deps=['k8s_setup'], labels=["observability"])
Expand Down
3 changes: 3 additions & 0 deletions rust/frontend/sample_configs/distributed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ log:
port: 50051
connect_timeout_ms: 5000
request_timeout_ms: 5000
compaction_client:
Grpc:
url: "compactionservice.chroma:50051" # todo
executor:
distributed:
connections_per_node: 5
Expand Down
57 changes: 57 additions & 0 deletions rust/frontend/src/compaction_client/compaction_client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
use super::{
grpc_compaction_client::{GrpcCompactionClient, GrpcCompactionClientConfig},
local_compaction_client::LocalCompactionClient,
};
use chroma_config::{registry::Registry, Configurable};
use chroma_error::ChromaError;
use chroma_system::System;
use chroma_types::{ManualCompactionError, ManualCompactionRequest, ManualCompactionResponse};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone)]
pub enum CompactionClient {
Local(LocalCompactionClient),
Grpc(GrpcCompactionClient),
}

impl CompactionClient {
pub async fn manually_compact(
&mut self,
request: ManualCompactionRequest,
) -> Result<ManualCompactionResponse, ManualCompactionError> {
match self {
CompactionClient::Local(client) => client.manually_compact(request).await,
CompactionClient::Grpc(client) => client.manually_compact(request).await,
}
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum CompactionClientConfig {
Local,
Grpc(GrpcCompactionClientConfig),
}

#[async_trait::async_trait]
impl Configurable<(CompactionClientConfig, System)> for CompactionClient {
async fn try_from_config(
(config, system): &(CompactionClientConfig, System),
registry: &Registry,
) -> Result<Self, Box<dyn ChromaError>> {
match config {
CompactionClientConfig::Local => {
let client =
LocalCompactionClient::try_from_config(&((), system.clone()), registry).await?;
Ok(CompactionClient::Local(client))
}
CompactionClientConfig::Grpc(grpc_config) => {
let client = GrpcCompactionClient::try_from_config(
&(grpc_config.clone(), system.clone()),
registry,
)
.await?;
Ok(CompactionClient::Grpc(client))
}
}
}
}
90 changes: 90 additions & 0 deletions rust/frontend/src/compaction_client/grpc_compaction_client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
use chroma_config::{registry::Registry, Configurable};
use chroma_error::ChromaError;
use chroma_sysdb::SysDb;
use chroma_system::System;
use chroma_types::{
chroma_proto::{self, compactor_client::CompactorClient},
CollectionUuid, ManualCompactionError, ManualCompactionRequest, ManualCompactionResponse,
};
use serde::{Deserialize, Serialize};
use thiserror::Error;

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GrpcCompactionClientConfig {
pub url: String,
}

#[derive(Debug, Clone)]
pub(super) struct GrpcCompactionClient {
sysdb: SysDb,
client: CompactorClient<tonic::transport::Channel>,
}

impl GrpcCompactionClient {
pub async fn manually_compact(
&mut self,
request: ManualCompactionRequest,
) -> Result<ManualCompactionResponse, ManualCompactionError> {
async fn get_version(sysdb: &mut SysDb, collection_id: CollectionUuid) -> i32 {
let mut collection = sysdb
.get_collections(Some(collection_id), None, None, None, None, 0)
.await
.unwrap(); // todo
let collection = collection.pop().unwrap(); // todo
return collection.version;
}

let version_before_compaction = get_version(&mut self.sysdb, request.collection_id).await;

self.client
.compact(chroma_proto::CompactionRequest {
ids: Some(chroma_proto::CollectionIds {
ids: vec![request.collection_id.to_string()],
}),
})
.await
.unwrap();

loop {
let version_after_compaction =
get_version(&mut self.sysdb, request.collection_id).await;
if version_after_compaction > version_before_compaction {
break;
}
// todo
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
}

Ok(ManualCompactionResponse {})
}
}

#[derive(Debug, Error)]
pub enum FromConfigError {
#[error("Failed to create gRPC client: {0}")]
GrpcClient(#[from] tonic::transport::Error),
}

impl ChromaError for FromConfigError {
fn code(&self) -> chroma_error::ErrorCodes {
match self {
FromConfigError::GrpcClient(_) => chroma_error::ErrorCodes::Internal,
}
}
}

#[async_trait::async_trait]
impl Configurable<(GrpcCompactionClientConfig, System)> for GrpcCompactionClient {
async fn try_from_config(
(config, _system): &(GrpcCompactionClientConfig, System),
registry: &Registry,
) -> Result<Self, Box<dyn ChromaError>> {
let client = CompactorClient::connect(config.url.clone())
.await
.map_err(|err| FromConfigError::GrpcClient(err).boxed())?;
Ok(Self {
client,
sysdb: registry.get().map_err(|err| err.boxed())?,
})
}
}
45 changes: 45 additions & 0 deletions rust/frontend/src/compaction_client/local_compaction_client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
use chroma_config::{registry::Registry, Configurable};
use chroma_error::ChromaError;
use chroma_log::LocalCompactionManager;
use chroma_system::{ComponentHandle, System};
use chroma_types::{ManualCompactionError, ManualCompactionRequest, ManualCompactionResponse};

#[derive(Debug, Clone)]
pub(super) struct LocalCompactionClient {
handle: ComponentHandle<LocalCompactionManager>,
}

impl LocalCompactionClient {
pub async fn manually_compact(
&mut self,
request: ManualCompactionRequest,

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Lint

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collectio...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_data...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embedding...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collectio...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_ver...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Rust tests / can-build-release

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/stress)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Rust tests / test (depot-ubuntu-22.04)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Rust tests / test-benches (depot-ubuntu-22.04-16)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_restart_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/auth/test_simple_rbac_authz.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_version_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_database_tenant_overw...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_restart_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/auth/test_simple_rbac_authz.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property/*' --ignore-gl...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property/*' --ignore-glob 'chromadb/t...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/auth/test_simple_rbac_authz.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/test_cli.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_cross_version_pers...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property/*' -...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_databas...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_version_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_database_tenant.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/stress)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_wi...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_version_...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_restart_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' --ignore-glob '...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_databas...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_cross_version_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/stress)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/test_cli.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_cross_version_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_collections_with_database_te...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/auth/test_simple_rbac_authz.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/auth/test_simple_rbac_authz.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_collections_with_database_te...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_collections_with_database_tenant_overwrite...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' --ign...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections_with_d...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_collections_with_database_tenant.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/auth/test_simple_rbac_authz.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' --ignore-glob 'chromadb/test/...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_add.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' ...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections_w...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_embeddings.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_cross_version...

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_restart_persist.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_filtering.py)

unused variable: `request`

Check failure on line 15 in rust/frontend/src/compaction_client/local_compaction_client.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/stress)

unused variable: `request`
) -> Result<ManualCompactionResponse, ManualCompactionError> {
// let compact_message = CompactionMessage {
// collection_id: request.collection_id,
// start_offset: start_log_offset,
// total_records,
// };
// self.handle
// .request(compact_message, None)
// .await
// .unwrap()
// .unwrap();
// todo

Ok(ManualCompactionResponse {})
}
}

#[async_trait::async_trait]
impl Configurable<((), System)> for LocalCompactionClient {
async fn try_from_config(
(_config, _system): &((), System),
registry: &Registry,
) -> Result<Self, Box<dyn ChromaError>> {
// Assume the registry has a compaction manager handle
let handle = registry
.get::<ComponentHandle<LocalCompactionManager>>()
.map_err(|err| err.boxed())?;
Ok(Self { handle })
}
}
3 changes: 3 additions & 0 deletions rust/frontend/src/compaction_client/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod compaction_client;
mod grpc_compaction_client;
mod local_compaction_client;
6 changes: 4 additions & 2 deletions rust/frontend/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{
compaction_client::compaction_client::CompactionClientConfig,
executor::config::{ExecutorConfig, LocalExecutorConfig},
CollectionsWithSegmentsProviderConfig,
};
Expand Down Expand Up @@ -61,11 +62,12 @@
pub log: LogConfig,
#[serde(default = "default_executor_config")]
pub executor: ExecutorConfig,
pub compaction_client: CompactionClientConfig,
}

impl FrontendConfig {
pub fn sqlite_in_memory() -> Self {
Self {

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Lint

missing field `compaction_client` in initializer of `config::FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collectio...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_data...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-thin-client (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embedding...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collectio...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_ver...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Rust tests / can-build-release

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/stress)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Rust tests / test (depot-ubuntu-22.04)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Rust tests / test-benches (depot-ubuntu-22.04-16)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_restart_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/auth/test_simple_rbac_authz.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_version_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_database_tenant_overw...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_restart_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/auth/test_simple_rbac_authz.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property/*' --ignore-gl...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property/*' --ignore-glob 'chromadb/t...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/auth/test_simple_rbac_authz.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/test_cli.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_cross_version_pers...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, --ignore-glob 'chromadb/test/property/*' -...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_databas...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_version_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_database_tenant.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/stress)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_wi...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_cross_version_...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_restart_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' --ignore-glob '...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, depot-ubuntu-22.04, chromadb/test/property/test_collections_with_databas...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, depot-ubuntu-22.04, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_cross_version_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/stress)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/test_cli.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_cross_version_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_collections_with_database_te...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/auth/test_simple_rbac_authz.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/auth/test_simple_rbac_authz.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_collections_with_database_te...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_collections_with_database_tenant_overwrite...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' --ign...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections_with_d...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, chromadb/test/property/test_collections_with_database_tenant.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-single-node-integration (3.9, windows-latest, chromadb/test/auth/test_simple_rbac_authz.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' --ignore-glob 'chromadb/test/...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_add.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, --ignore-glob 'chromadb/test/property/*' ...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections_w...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_embeddings.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_sysdb.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_cross_version...

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-bindings (3.9, windows-latest, chromadb/test/property/test_restart_persist.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_collections.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/property/test_filtering.py)

missing field `compaction_client` in initializer of `FrontendConfig`

Check failure on line 70 in rust/frontend/src/config.rs

View workflow job for this annotation

GitHub Actions / Python tests / test-rust-single-node-integration (3.9, windows-latest, chromadb/test/stress)

missing field `compaction_client` in initializer of `FrontendConfig`
allow_reset: false,
sqlitedb: Some(SqliteDBConfig {
url: None,
Expand Down Expand Up @@ -181,8 +183,8 @@
let sysdb_config = config.frontend.sysdb;
let sysdb_config = match sysdb_config {
chroma_sysdb::SysDbConfig::Grpc(grpc_sys_db_config) => grpc_sys_db_config,
chroma_sysdb::SysDbConfig::Sqlite(_) => {
panic!("Expected grpc sysdb config, got sqlite sysdb config")
_ => {
panic!("Expected grpc sysdb config")
}
};
assert_eq!(sysdb_config.host, "sysdb.chroma");
Expand Down
28 changes: 23 additions & 5 deletions rust/frontend/src/impls/service_based_frontend.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
config::FrontendConfig, executor::Executor, types::errors::ValidationError,
CollectionsWithSegmentsProvider,
compaction_client::compaction_client::CompactionClient, config::FrontendConfig,
executor::Executor, types::errors::ValidationError, CollectionsWithSegmentsProvider,
};
use backon::Retryable;
use chroma_config::{registry, Configurable};
Expand All @@ -25,9 +25,10 @@ use chroma_types::{
GetCollectionsError, GetDatabaseError, GetDatabaseRequest, GetDatabaseResponse, GetRequest,
GetResponse, GetTenantError, GetTenantRequest, GetTenantResponse, HealthCheckResponse,
HeartbeatError, HeartbeatResponse, Include, ListCollectionsRequest, ListCollectionsResponse,
ListDatabasesError, ListDatabasesRequest, ListDatabasesResponse, Metadata, Operation,
OperationRecord, QueryError, QueryRequest, QueryResponse, ResetError, ResetResponse, Segment,
SegmentScope, SegmentType, SegmentUuid, SingleNodeHnswParameters, UpdateCollectionError,
ListDatabasesError, ListDatabasesRequest, ListDatabasesResponse, ManualCompactionError,
ManualCompactionRequest, ManualCompactionResponse, Metadata, Operation, OperationRecord,
QueryError, QueryRequest, QueryResponse, ResetError, ResetResponse, Segment, SegmentScope,
SegmentType, SegmentUuid, SingleNodeHnswParameters, UpdateCollectionError,
UpdateCollectionRecordsError, UpdateCollectionRecordsRequest, UpdateCollectionRecordsResponse,
UpdateCollectionRequest, UpdateCollectionResponse, UpsertCollectionRecordsError,
UpsertCollectionRecordsRequest, UpsertCollectionRecordsResponse, Where,
Expand All @@ -54,6 +55,7 @@ pub struct ServiceBasedFrontend {
executor: Executor,
log_client: Log,
sysdb_client: SysDb,
compaction_client: CompactionClient,
collections_with_segments_provider: CollectionsWithSegmentsProvider,
max_batch_size: u32,
metrics: Arc<Metrics>,
Expand All @@ -63,6 +65,7 @@ impl ServiceBasedFrontend {
pub fn new(
allow_reset: bool,
sysdb_client: SysDb,
compaction_client: CompactionClient,
collections_with_segments_provider: CollectionsWithSegmentsProvider,
log_client: Log,
executor: Executor,
Expand All @@ -84,6 +87,7 @@ impl ServiceBasedFrontend {
executor,
log_client,
sysdb_client,
compaction_client,
collections_with_segments_provider,
max_batch_size,
metrics,
Expand Down Expand Up @@ -194,6 +198,13 @@ impl ServiceBasedFrontend {
Ok(ResetResponse {})
}

pub async fn manually_compact(
&mut self,
request: ManualCompactionRequest,
) -> Result<ManualCompactionResponse, ManualCompactionError> {
self.compaction_client.manually_compact(request).await
}

pub async fn create_tenant(
&mut self,
CreateTenantRequest { name, .. }: CreateTenantRequest,
Expand Down Expand Up @@ -1089,9 +1100,16 @@ impl Configurable<(FrontendConfig, System)> for ServiceBasedFrontend {
let executor =
Executor::try_from_config(&(config.executor.clone(), system.clone()), registry).await?;

let compaction_client = CompactionClient::try_from_config(
&(config.compaction_client.clone(), system.clone()),
registry,
)
.await?;

Ok(ServiceBasedFrontend::new(
config.allow_reset,
sysdb,
compaction_client,
collections_with_segments_provider,
log,
executor,
Expand Down
1 change: 1 addition & 0 deletions rust/frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{path::Path, sync::Arc};

mod ac;
pub mod auth;
pub mod compaction_client; // todo
pub mod config;
#[allow(dead_code)]
pub mod executor;
Expand Down
2 changes: 2 additions & 0 deletions rust/python_bindings/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ impl Bindings {
collections_with_segments_provider: collection_cache_config,
log: log_config,
executor: executor_config,
compaction_client:
chroma_frontend::compaction_client::compaction_client::CompactionClientConfig::Local,
};

let frontend = runtime.block_on(async {
Expand Down
19 changes: 19 additions & 0 deletions rust/types/src/api_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,25 @@ impl ChromaError for ResetError {
}
}

#[non_exhaustive]
#[derive(Validate)]
pub struct ManualCompactionRequest {
pub collection_id: CollectionUuid,
}

impl ManualCompactionRequest {
pub fn try_new(collection_id: CollectionUuid) -> Result<Self, ChromaValidationError> {
let request = Self { collection_id };
request.validate().map_err(ChromaValidationError::from)?;
Ok(request)
}
}

pub struct ManualCompactionResponse {}

#[derive(Error, Debug)]
pub enum ManualCompactionError {}

#[derive(Serialize, ToSchema)]
pub struct ChecklistResponse {
pub max_batch_size: u32,
Expand Down
4 changes: 4 additions & 0 deletions rust/worker/src/compactor/compaction_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ impl Handler<OneOffCompactionMessage> for CompactionManager {
"One-off collections queued: {:?}",
self.scheduler.get_oneoff_collections()
);

tracing::info!("CompactionManager: Performing scheduled compaction");
let ids = self.compact_batch().await;
self.hnsw_index_provider.purge_by_id(&ids).await;
}
}

Expand Down
Loading
Loading