You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`CompactCollection` and `CompactAll` run explicit compaction via Chroma's local compaction manager.
81
+
- You can pass both `TenantID` and `DatabaseName` in the same request.
82
+
- For `CompactCollection`, collection name lookup is performed inside that tenant+database scope.
83
+
- When omitted, tenant/database scope defaults to `default_tenant` and `default_database`.
84
+
- For each collection, compaction runs backfill then log purge (WAL cleanup).
85
+
- This is not a full HNSW rebuild from scratch and does not change collection configuration/schema.
86
+
- In server mode, the server is unavailable while compaction runs (stop -> compact in embedded mode -> restart).
87
+
-`CompactAll` continues across collections and reports per-collection failures in `result.Collections[i].Error`.
88
+
-`result.CollectionCount` is attempted collections, not only successful collections.
89
+
-`pending_ops_before`/`pending_ops_after` are advisory; if unavailable they are omitted and surfaced via `pending_ops_before_error`/`pending_ops_after_error`.
90
+
62
91
Backup constraints (applies to server and embedded backup):
63
92
64
93
-`DestinationPath` must not exist or must be an empty directory.
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,6 +328,8 @@ For a detailed, example-heavy reference of the currently implemented Go APIs, se
328
328
|`(*Server) Stop() error`| Gracefully stop the server. |
329
329
|`(*Server) Close() error`| Stop and free resources. |
330
330
|`(*Server) Backup(options ...BackupOption) (*BackupManifest, error)`| Snapshot persisted data with optional restart. |
331
+
|`(*Server) CompactCollection(request CompactCollectionRequest) (*CompactionResult, error)`| Run explicit compaction for one collection (server restarts after operation). Scope can include both `TenantID` and `DatabaseName` together. |
332
+
|`(*Server) CompactAll(request CompactAllRequest) (*CompactionResult, error)`| Run explicit compaction for all collections (server restarts after operation). Scope can include both `TenantID` and `DatabaseName` together. Per-collection failures are reported in `result.Collections[i].Error`. |
@@ -355,10 +357,45 @@ For a detailed, example-heavy reference of the currently implemented Go APIs, se
355
357
|`(*Embedded) Add(request EmbeddedAddRequest) error`| Add records without HTTP. |
356
358
|`(*Embedded) Query(request EmbeddedQueryRequest) (*EmbeddedQueryResponse, error)`| Query records without HTTP (supports `where` and `where_document`). |
357
359
|`(*Embedded) IndexingStatus(request EmbeddedIndexingStatusRequest) (*EmbeddedIndexingStatusResponse, error)`| Get collection indexing status (may be unimplemented in local backend). |
360
+
|`(*Embedded) CompactCollection(request CompactCollectionRequest) (*CompactionResult, error)`| Run explicit compaction for one collection. Scope can include both `TenantID` and `DatabaseName` together. |
361
+
|`(*Embedded) CompactAll(request CompactAllRequest) (*CompactionResult, error)`| Run explicit compaction for all collections. Scope can include both `TenantID` and `DatabaseName` together. Per-collection failures are reported in `result.Collections[i].Error`. |
358
362
|`(*Embedded) Reset() error`| Reset local state when enabled. |
359
363
|`(*Embedded) Backup(options ...BackupOption) (*BackupManifest, error)`| Snapshot persisted data with optional reopen. |
`CompactCollection` and `CompactAll` run Chroma explicit compaction through the local compaction manager.
369
+
370
+
Per compacted collection, the operation performs:
371
+
- backfill (apply pending log operations into collection/index state)
372
+
- log purge (remove compacted WAL log records)
373
+
374
+
This compaction is not a full index rebuild. In particular, it does not rebuild HNSW from scratch or change collection configuration/schema.
375
+
376
+
Operational notes:
377
+
- You can scope compaction with both `TenantID` and `DatabaseName` in the same request.
378
+
- For `CompactCollection`, collection name resolution happens inside that tenant+database scope.
379
+
- If omitted, scope defaults to `default_tenant` and `default_database`.
380
+
- In server mode, the server is unavailable during compaction because it is stopped, compacted via embedded mode, then restarted.
381
+
-`CompactAll` continues across collections and records per-collection failures in `result.Collections[i].Error`.
382
+
-`result.CollectionCount` is the number of attempted collections (including entries with `Error`).
383
+
-`pending_ops_before`/`pending_ops_after` are advisory metrics; when unavailable they are omitted and `pending_ops_before_error`/`pending_ops_after_error` explain why.
0 commit comments