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

Panic from vector index (possibly from stats) #8844

Open
coffeegoddd opened this issue Feb 10, 2025 · 2 comments
Open

Panic from vector index (possibly from stats) #8844

coffeegoddd opened this issue Feb 10, 2025 · 2 comments
Assignees
Labels
analyzer bug Something isn't working panic vectors

Comments

@coffeegoddd
Copy link
Contributor

Dolt v1.49.1

Hit a panic, related to a vector index in my table:

panic: interface conversion: durable.Index is durable.proximityIndex, not durable.prollyIndex

goroutine 90 [running]:
github.com/dolthub/dolt/go/libraries/doltcore/doltdb/durable.ProllyMapFromIndex(...)
	/Users/dustin/src/dolt/go/libraries/doltcore/doltdb/durable/index.go:277
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro.newIdxMeta(0x14002174640, 0x14000c73838, 0x14000147760, {0x1052955a0, _}, {_, _, _})
	/Users/dustin/src/dolt/go/libraries/doltcore/sqle/statspro/analyze.go:275 +0xa98
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro.(*Provider).checkRefresh(0x14000208870, 0x14002174640, {0x1051f1220, 0x14001a84540}, {0x14001d90406, 0x17}, {0x14000a0133b, 0x4}, 0x3fe0000000000000)
	/Users/dustin/src/dolt/go/libraries/doltcore/sqle/statspro/auto_refresh.go:220 +0x1194
github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro.(*Provider).InitAutoRefreshWithParams.func1({0x1051f70d0, 0x14002178960})
	/Users/dustin/src/dolt/go/libraries/doltcore/sqle/statspro/auto_refresh.go:94 +0x42c
github.com/dolthub/go-mysql-server/sql.(*BackgroundThreads).Add.func1()
	/Users/dustin/go/pkg/mod/github.com/dolthub/[email protected]/sql/background_threads.go:67 +0x60
created by github.com/dolthub/go-mysql-server/sql.(*BackgroundThreads).Add in goroutine 27
	/Users/dustin/go/pkg/mod/github.com/dolthub/[email protected]/sql/background_threads.go:65 +0x20c

my schema is:

CREATE TABLE `langchain_dolt_embedding` (
  `collection_id` varchar(36),
  `embedding` json,
  `document` longtext,
  `cmetadata` json,
  `uuid` varchar(36) NOT NULL,
  PRIMARY KEY (`uuid`),
  KEY `langchain_dolt_embedding_collection_id` (`collection_id`),
  VECTOR KEY `langchain_dolt_embedding_embedding_idx` (`embedding`),
  CONSTRAINT `langchain_dolt_embedding_collection_id_fkey` FOREIGN KEY (`collection_id`) REFERENCES `langchain_dolt_collection` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin
@max-hoffman
Copy link
Contributor

I'll test this in my stats replacement PR.

@nicktobey
Copy link
Contributor

It looks like stats is trying to analyze a vector index and trying to treat it like a regular index.

I don't know how much value there is for stats to analyze vector indexes, since vector indexes aren't ordered in the traditional sense, so you can't glean stuff like min/max/most common values. There might be vector-specific stats information we could gather, but the logic for that would likely be completely different than the currents stats logic.

I imagine that right now, the stats provider should ignore any indexes whose derived type is durable.proximityIndex.

@timsehn timsehn added bug Something isn't working panic analyzer vectors labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer bug Something isn't working panic vectors
Projects
None yet
Development

No branches or pull requests

4 participants