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

PITR : Catalog not getting updated when we create index and restore to previous snapshot. #9137

Open
sonalsagarwal opened this issue Jun 29, 2021 · 0 comments
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/low Low priority
Projects

Comments

@sonalsagarwal
Copy link

sonalsagarwal commented Jun 29, 2021

Jira Link: DB-2388

ycqlsh> create index testidx on yb_pitr_test.employees(salary);
ycqlsh> describe yb_pitr_test.employees

CREATE TABLE yb_pitr_test.employees (
    employee_no int PRIMARY KEY,
    name text,
    department text,
    salary int
) WITH default_time_to_live = 0
    AND transactions = {'enabled': 'true'};
CREATE INDEX testidx ON yb_pitr_test.employees (name, employee_no)
    WITH transactions = {'enabled': 'true'};
ycqlsh> explain select * from yb_pitr_test.employees where name='John Zimmerman' ;

 QUERY PLAN
-----------------------------------------------------------------
 Index Scan using yb_pitr_test.testidx on yb_pitr_test.employees
   Key Conditions: (name = 'John Zimmerman')                    

Restore to previous version :

bin/yb-admin -master_addresses=172.151.20.139,172.151.23.237,172.151.31.9 restore_snapshot_schedule e0239f77-2281-4a37-8ea5-4a7278fe98d8 minus 1m

The describe on keyspace still shows the index, but query on table doesnot show usage of index. When we create an index with same name, it gets created successfully, and describe keyspace also shows the information for new index.
The restore is working properly, just that the describe information is not updated after restore.

ycqlsh> describe yb_pitr_test.employees

CREATE TABLE yb_pitr_test.employees (
    employee_no int PRIMARY KEY,
    name text,
    department text,
    salary int
) WITH default_time_to_live = 0
    AND transactions = {'enabled': 'true'};
CREATE INDEX testidx ON yb_pitr_test.employees (name, employee_no)
    WITH transactions = {'enabled': 'true'};
ycqlsh> explain select * from yb_pitr_test.employees where name='John Zimmerman' ;

 QUERY PLAN
-------------------------------------
 Seq Scan on yb_pitr_test.employees 
   Filter: (name = 'John Zimmerman')


ycqlsh> create index testidx on yb_pitr_test.employees(salary);
ycqlsh> describe yb_pitr_test.employees

CREATE TABLE yb_pitr_test.employees (
    employee_no int PRIMARY KEY,
    name text,
    department text,
    salary int
) WITH default_time_to_live = 0
    AND transactions = {'enabled': 'true'};
CREATE INDEX testidx ON yb_pitr_test.employees (salary, employee_no)
    WITH transactions = {'enabled': 'true'};

@sonalsagarwal sonalsagarwal added the area/ycql Yugabyte CQL (YCQL) label Jun 29, 2021
@sonalsagarwal sonalsagarwal added this to To do in PITR via automation Jun 29, 2021
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 9, 2022
@yugabyte-ci yugabyte-ci added area/docdb YugabyteDB core features and removed area/ycql Yugabyte CQL (YCQL) labels Sep 18, 2022
@yugabyte-ci yugabyte-ci added priority/low Low priority and removed priority/medium Medium priority issue labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/low Low priority
Projects
PITR
To do
Status: No status
Development

No branches or pull requests

2 participants