Skip to content

fix(seekdb): make SeekDB runnable from the web UI - #895

Merged
jamesgao-jpg merged 8 commits into
zilliztech:mainfrom
serhiizghama:fix/seekdb-web-ui-config
Nov 24, 2026
Merged

jamesgao-jpg merged 8 commits into
zilliztech:mainfrom
serhiizghama:fix/seekdb-web-ui-config

Conversation

@serhiizghama

Copy link
Copy Markdown
Contributor

SeekDB shows up in the web UI's database picker, but any run with it dies at task generation with TypeError: 'NoneType' object is not callable. It has no entry in CASE_CONFIG_MAP, so the UI sends no index type, generate_tasks falls back to AUTOINDEX, and _seekdb_case_config only knows HNSW. Even with the right class, SeekDBHNSWConfig requires m, ef_construction and ef_search with no defaults, and the UI had no inputs for them.

This is the same error people reported for OceanBase in #689 (fixed by #691); the SeekDB backend came later in #770 and didn't get a UI entry.

Added SeekDB to the map with an HNSW index type plus m, ef_construction and ef_search inputs, on both Load and Performance (the model needs ef_search even for load-only cases). Since SeekDB runs on the OceanBase vector engine, I copied the bounds and defaults from the OceanBase inputs rather than inventing new ones. If you'd rather use SeekDB's own defaults there, happy to change them.

The new test drives generate_tasks with the UI defaults; without the map entry it fails with the same TypeError.

)


def test_ui_exposes_every_field_the_hnsw_model_requires():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tests/test_seekdb_config.py line:43
Low ---- This new regression test is not executed by PR CI: .github/workflows/pull_request.yml runs make unittest, which invokes only tests/test_dataset.py::TestDataSet::test_download_small (see Makefile), and make lint checks only vectordb_bench/. The four green matrix jobs never run tests/test_seekdb_config.py, so the SeekDB task-generation fix has no automated regression protection; consider wiring the new test into the CI test step.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The issue is confirmed fixed.

@serhiizghama

Copy link
Copy Markdown
Contributor Author

Good point, nothing outside test_dataset was running in CI. Added tests/test_seekdb_config.py to the make unittest target. It's offline and only needs the .[test] install, so it should be fine on the Windows jobs too.

@jamesgao-jpg jamesgao-jpg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing the SeekDB UI task generation and adding the CI coverage! I found one issue with the new controls and a few existing client risks that the UI path exposes:

inputHelp="HNSW graph degree (m) for SeekDB",
inputType=InputType.Number,
inputConfig={
"min": 4,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] Validate the existing index before reporting these build settings

The UI allows users to set these parameters and select Index already exists, but the existing SeekDB client skips index creation without validating the existing index parameters or metric. A run can therefore report the newly selected m and ef_construction while searching a different index. This client limitation predates the PR, but this change makes the UI path usable. Could we validate the actual index before reuse, or reject reuse when it cannot be verified, and add a mismatch test?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding the reuse check. I found one remaining edge case: the new regex checks the index name and parameters but accepts any indexed column. In a mocked SHOW CREATE TABLE reproduction, vidx on other_embedding passed validation even though the benchmark searches embedding. The lack of this validation predates the PR; this is a gap in the new safeguard, not a regression. Could the check also require the index to target embedding, with a mismatch regression test? I haven't tested the query against a live SeekDB instance.

CaseLabel.Load: QdrantLocalLoadConfig,
CaseLabel.Performance: QdrantLocalPerformanceConfig,
},
DB.SeekDB: {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] Redact the SeekDB password from initialization logs

This UI integration makes an existing client issue reachable: SeekDBConfig.to_dict() unwraps the password and the client logs the entire dictionary at INFO. I confirmed this with a mocked initialization using a synthetic password. Could the client omit or redact credentials before logging, with a regression test?

CaseLabel.Performance: QdrantLocalPerformanceConfig,
},
DB.SeekDB: {
CaseLabel.Load: SeekDBLoadConfig,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] Preserve instance-wide resource settings by default

Now that the UI can start a SeekDB run, it also reaches the existing client initialization, which executes ALTER SYSTEM for memory_limit and cpu_count, even when reusing an existing index. These are instance-wide settings, so a benchmark can change an operator-configured resource policy without an explicit choice. Could we preserve them by default and make any tuning opt-in?

label=CaseConfigParamType.ef_construction,
inputHelp="HNSW ef_construction for SeekDB",
inputType=InputType.Number,
inputConfig={

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Reject incompatible HNSW parameter combinations before running

The new inputs allow m=64 with ef_construction=8, and the config model accepts the pair. OceanBase HNSW documentation states that ef_construction must exceed m. The existing client drops the old table before creating the new index, so waiting for the backend to reject an invalid pair can happen after that destructive step. Could we validate the pair before starting the run and add a boundary test?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding the ef_construction > m validation. One boundary remains: the new UI and model accept m=64, ef_construction=1001, but SeekDB's regression test rejects that value. In a mocked rejection I confirmed that the client drops and recreates the table before attempting index creation. The backend risk predates this PR, but the new UI now exposes the value. Could we validate the supported upper bound before starting and add a boundary test?

@serhiizghama

Copy link
Copy Markdown
Contributor Author

@jamesgao-jpg pushed fixes for all four.

Reusing an index now reads SHOW CREATE TABLE and compares distance, type, m and ef_construction with the case config. Any mismatch fails before the run starts, and so does a table where the vector index can't be found. The ALTER SYSTEM calls for memory_limit and cpu_count only run when you opt in (--reset-resource-limits on the CLI, a checkbox in the UI). The init log masks the password. SeekDBHNSWConfig rejects ef_construction <= m at construction, so the UI and the CLI both fail before anything gets dropped.

I checked the DDL format and the bound against a local oceanbase/seekdb container (1.4.0). It answers m=16, ef_construction=16 with "ef_construction less than or equal to m value is not supported", and 17 is accepted. The new tests in tests/test_seekdb_client.py mock the connection, so they run offline. I added them to make unittest.

One thing to flag: anyone who relied on the old implicit ALTER SYSTEM from the CLI now has to pass the flag. If you'd rather keep the reset on by default for the CLI, I can flip that.

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: serhiizghama
To complete the pull request process, please assign jamesgao-jpg after the PR has been reviewed.
You can assign the PR to them by writing /assign @jamesgao-jpg in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@serhiizghama

Copy link
Copy Markdown
Contributor Author

Merged main to clear the conflict in models.py (the new LanceDB scalar index params landed next to reset_resource_limits). Nothing else changed.

self._cursor.execute(f"SHOW CREATE TABLE {self.table_name}")
row = self._cursor.fetchone()
ddl = row[1] if row else ""
m = re.search(rf"VECTOR KEY `?{self._index_name}`?\s*\([^)]*\)\s*WITH\s*\(([^)]*)\)", ddl, re.IGNORECASE)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] Validate the column of a reused index

The new check matches any column inside vidx's parentheses. In a mocked SHOW CREATE TABLE reproduction, an index on other_embedding passed even though benchmark searches use embedding; the check therefore cannot establish that the verified index is the one being searched. This lack of validation predates the PR, but the new safeguard should check the indexed column too. Could you reject a column mismatch and add a regression test? I haven't tested the resulting query against a live SeekDB instance.

@model_validator(mode="after")
def check_ef_construction(self):
# The client drops the old table before creating the index, so reject this up front.
if self.ef_construction <= self.m:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] Validate the upper bound before dropping the table

The new UI and validator accept m=64, ef_construction=1001, but SeekDB's regression test rejects this value. In a mocked rejection, the client dropped and recreated the table before attempting the invalid index. The backend risk predates this PR, but the new UI exposes the value. Could we validate the supported upper bound before initialization and add a boundary test?

@jamesgao-jpg

Copy link
Copy Markdown
Collaborator

Hi, thanks for the update! I did a re-scan and found some new pending blockers not found in the first round.

@serhiizghama

Copy link
Copy Markdown
Contributor Author

@jamesgao-jpg pushed both.

The reuse check now also reads the column inside vidx (...) and fails if it isn't embedding, with a test using your other_embedding case.

For the bounds I went to the source of that error rather than just the test: ob_vector_index_util.cpp accepts m in 5..128 and ef_construction in 5..1000, on top of ef_construction > m. Those are now Field(ge=..., le=...) on SeekDBHNSWConfig, so a bad value fails when the case config is built, before the client touches the table. The UI inputs follow the same limits (m min 5, ef_construction max 1000). Tests cover m=4, m=129, m=64, ef_construction=1001, and that the UI min/max values are all accepted by the model.

I left ef_search alone since it goes through the session variable, not the index DDL. Happy to bound that too if you'd like.

@jamesgao-jpg
jamesgao-jpg merged commit 9107eef into zilliztech:main Nov 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants