Skip to content
Open
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
16 changes: 9 additions & 7 deletions chromadb/db/base.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from typing import Any, Optional, Sequence, Tuple, Type
from types import TracebackType
from typing_extensions import Protocol, Self, Literal
from abc import ABC, abstractmethod
from itertools import count, islice
from threading import local
from overrides import override, EnforceOverrides
from types import TracebackType
from typing import Any, Optional, Sequence, Tuple, Type
from uuid import UUID

import pypika
import pypika.queries
from chromadb.config import System, Component
from uuid import UUID
from itertools import islice, count
from overrides import EnforceOverrides, override
from typing_extensions import Literal, Protocol, Self

from chromadb.config import Component, System


class Cursor(Protocol):
Expand Down
11 changes: 7 additions & 4 deletions chromadb/ingest/impl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ def trigger_vector_segments_max_seq_id_migration(
)
collection_ids_with_unmigrated_segments = [row[0] for row in cur.fetchall()]

if len(collection_ids_with_unmigrated_segments) == 0:
if not collection_ids_with_unmigrated_segments:
return

for collection_id in collection_ids_with_unmigrated_segments:
# Loading the segment triggers the migration on init
segment_manager.get_segment(UUID(collection_id), VectorReader)
vector_reader = VectorReader # Hoist for local lookup
uuid_list = [UUID(cid) for cid in collection_ids_with_unmigrated_segments]
get_segment = segment_manager.get_segment # Localize for minor performance

for collection_uuid in uuid_list:
get_segment(collection_uuid, vector_reader)