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

[YSQL] Create index on table with existing data will raise error #1067

Closed
robertpang opened this issue Mar 24, 2019 · 1 comment
Closed

[YSQL] Create index on table with existing data will raise error #1067

robertpang opened this issue Mar 24, 2019 · 1 comment
Assignees
Labels
kind/bug This issue is a bug

Comments

@robertpang
Copy link
Contributor

When creating an index on a table with existing data, an error may be raised:

postgres=# CREATE TABLE index_test (col1 int, col2 int);
CREATE TABLE
postgres=# INSERT INTO index_test (col1, col2) VALUES (1, 100);
INSERT 0 1
postgres=# INSERT INTO index_test (col1, col2) VALUES (2, 200);
INSERT 0 1
postgres=# CREATE INDEX index_test_idx1 ON index_test(col1);
ERROR:  Illegal state: Only non-transactional ops should be buffered

The error leaves the session in an inconsistent buffer state and subsequent commands will hang.

@robertpang robertpang added the kind/bug This issue is a bug label Mar 24, 2019
@robertpang robertpang self-assigned this Mar 24, 2019
yugabyte-ci pushed a commit that referenced this issue Mar 25, 2019
Summary: Buffering of write operations in CREATE INDEX should only apply to initdb.

Test Plan: yb_create_index.sql

Reviewers: mikhail

Reviewed By: mikhail

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D6390
@robertpang
Copy link
Contributor Author

Resolved in commit 0341b29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant