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

Disable consolidate_update_fragments for TileDB Cloud URIs #536

Merged
merged 3 commits into from
Oct 2, 2024
Merged
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
12 changes: 12 additions & 0 deletions apis/python/src/tiledb/vector_search/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os
import time
import warnings
from abc import ABCMeta
from abc import abstractmethod
from typing import Any, Mapping, Optional
Expand Down Expand Up @@ -800,6 +801,17 @@ def _set_has_updates(self, has_updates: bool = True):
self.group = tiledb.Group(self.uri, "r", ctx=tiledb.Ctx(self.config))

def _consolidate_update_fragments(self):
# Disable update fragment consolidation for TileDB Cloud URIs
# as this is not supported.
if self.uri.startswith("tiledb://"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should log a message here (once only) at a low threshold (debug level).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a warning for this

warnings.warn(
"Update fragment consolidation is not supported for `tiledb://` URIs. "
"Executing multiple updates without consolidating the update fragments can "
"result in poor search performance. Please make sure that you periodically "
"execute `_consolidate_update_fragments` using the storage filesystem URI.",
stacklevel=2,
)
return
with tiledb.scope_ctx(ctx_or_config=self.config):
fragments_info = tiledb.array_fragments(self.updates_array_uri)
count_fragments = 0
Expand Down
Loading