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

Select statement gets stuck due to indexing issue #1943

Open
ostafen opened this issue Apr 2, 2024 · 0 comments
Open

Select statement gets stuck due to indexing issue #1943

ostafen opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ostafen
Copy link
Collaborator

ostafen commented Apr 2, 2024

What happened

A select statement over a table with a primary key of type VARCHAR(512) completely gets stuck and returns no result rows.

What you expected to happen

The query either returns an error or some result rows.

How to reproduce it (as minimally and precisely as possible)

Initialize a table as follows:

BEGIN TRANSACTION;

CREATE TABLE IF NOT EXISTS tb (
   pk VARCHAR(512) NOT NULL,

   PRIMARY KEY (pk)
);

INSERT INTO tb(pk) VALUES ('test');
COMMIT;

and run a select statement:

SELECT * FROM tb;

Environment

immudb v1.9.0-RC2

Additional info (any other context about the problem)

The problem is due to the following indexing issue:

immudb  2024/04/02 09:27:49 ERROR: indexing failed at 'data' due to error: tbtree: max key size exceeded

Indexing a primary key of VARCHAR(512) type produces index keys exceeding the maximum key size allowed by immudb
(the issue doesn't show with types of shorter size, such as VARCHAR(256) or numeric types).
Such error is never forwarded correctly and causes the code to get stuck on the following lines:

err = indexer.WaitForIndexingUpto(ctx, txID)
if err != nil {
    return nil, err
}
@ostafen ostafen added the bug Something isn't working label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant