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

[DocDb] `ERROR: ybctid DocKey([], [16754]) not found in indexed table. index table id is 00004007000030008000000000000a76 #20777

Open
1 task done
shishir2001-yb opened this issue Jan 25, 2024 · 9 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/high High Priority qa_stress Bugs identified via Stress automation QA QA filed bugs

Comments

@shishir2001-yb
Copy link

shishir2001-yb commented Jan 25, 2024

Jira Link: DB-9775

Description

Tried on version 2.21.0.0-b496

During the execution of the Cross-DB Concurrent DDLs Sample app, sometimes connection creation fails with the below

ERROR: ybctid DocKey([], [16754]) not found in indexed table. index table id is 00004007000030008000000000000a76

UPDATE: This error also occurs in global catalog mode.

List of DDLs :

private static List<List<String>> ddlList = List.of(
            List.of("CREATE INDEX idx1 ON ? (k)", "DROP INDEX idx1"),
            List.of("CREATE TABLE tempTable1 AS SELECT * FROM ? limit 1000000", "ALTER TABLE tempTable1 RENAME TO tempTable1_new", "DROP TABLE tempTable1_new"),
            List.of("CREATE MATERIALIZED VIEW mv1 as SELECT k from ? limit 10000", "REFRESH MATERIALIZED VIEW mv1", "DROP MATERIALIZED VIEW mv1"),
            List.of("ALTER TABLE ? ADD newColumn1 TEXT DEFAULT 'dummyString'", "ALTER TABLE ? DROP newColumn1"),
            List.of("ALTER TABLE ? ADD newColumn2 TEXT NULL", "ALTER TABLE ? DROP newColumn2"),
            List.of("CREATE VIEW view1_? AS SELECT k from ?", "DROP VIEW view1_?"),
            List.of("ALTER TABLE ? ADD newColumn3 TEXT DEFAULT 'dummyString'", "ALTER TABLE ? ALTER newColumn3 TYPE VARCHAR(1000)", "ALTER TABLE ? DROP newColumn3"),
            List.of("CREATE TABLE tempTable2 AS SELECT * FROM ? limit 1000000", "CREATE INDEX idx2 ON tempTable2(k)", "ALTER TABLE ? ADD newColumn4 TEXT DEFAULT 'dummyString'", "ALTER TABLE tempTable2 ADD newColumn2 TEXT DEFAULT 'dummyString'", "TRUNCATE table ? cascade", "ALTER TABLE ? DROP newColumn4", "ALTER TABLE tempTable2 DROP newColumn2", "DROP INDEX idx2", "DROP TABLE tempTable2"),
            List.of("CREATE VIEW view2_? AS SELECT k from ?", "CREATE MATERIALIZED VIEW mv2 as SELECT k from ? limit 10000", "REFRESH MATERIALIZED VIEW mv2", "DROP MATERIALIZED VIEW mv2", "DROP VIEW view2_?")
 );

Context:

  1. We are executing Cross-DB DDLs Sample app with multiple threads. Notably, we ensure there is no simultaneous execution of DDL operations within the same database.
  2. No Global DDLs are being executed.

Sample app details:
1. Start Cross-DB Concurrent DDLs Sample app which will execute both DDLs and DMLs across databases in parallel. (30 write threads, 15 databases and 10 Read threads)

[Logs](https://drive.google.com/file/d/1gdZFljpfr90Eo9ItTV3sbAyZk_WDi3xu/view?usp=sharing)

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@shishir2001-yb shishir2001-yb added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Jan 25, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jan 25, 2024
@shishir2001-yb shishir2001-yb added QA QA filed bugs qa_stress Bugs identified via Stress automation labels Jan 25, 2024
@shishir2001-yb shishir2001-yb changed the title [YSQL] [Cross-DB-DDL] `ERROR: ybctid DocKey([], [16754]) not found in indexed table. index table id is 00004007000030008000000000000a76 [YSQL] `ERROR: ybctid DocKey([], [16754]) not found in indexed table. index table id is 00004007000030008000000000000a76 Jan 31, 2024
@shishir2001-yb
Copy link
Author

UPDATE: This error also occurs in global catalog mode.

@yugabyte-ci yugabyte-ci assigned myang2021 and unassigned tverona1 Jan 31, 2024
@yugabyte-ci yugabyte-ci added priority/high High Priority and removed status/awaiting-triage Issue awaiting triage priority/medium Medium priority issue labels Jan 31, 2024
@rthallamko3 rthallamko3 added the area/docdb YugabyteDB core features label Feb 5, 2024
@myang2021
Copy link
Contributor

This bug can be reproduced in global catalog version mode in 2.20.1.0.

@myang2021
Copy link
Contributor

This bug can also be reproduced in global catalog version mode in 2.18.5.2. So this is not a recent regression bug.

@myang2021
Copy link
Contributor

I tried with yugabyte-2.16.8.0, could not reproduce.

@myang2021
Copy link
Contributor

I did not see persistent corruption and it seems that when reading from the index and base table, the same read time somehow allowed returning the given tuple_id but same read time applied on the base table filtered that row out.

@rthallamko3
Copy link
Contributor

@shishir2001-yb , Is this issue still relevant on master?

@shishir2001-yb
Copy link
Author

@rthallamko3, yes it is consistently reproducible in all the runs.

@yugabyte-ci yugabyte-ci removed the area/ysql Yugabyte SQL (YSQL) label Aug 8, 2024
@yugabyte-ci yugabyte-ci changed the title [YSQL] `ERROR: ybctid DocKey([], [16754]) not found in indexed table. index table id is 00004007000030008000000000000a76 [DocDb] `ERROR: ybctid DocKey([], [16754]) not found in indexed table. index table id is 00004007000030008000000000000a76 Aug 8, 2024
@rthallamko3
Copy link
Contributor

Per @myang2021 's comment, this can be reproduced using sample apps from https://github.com/yugabyte/yb-stress-test/releases/download/ssa_1.1.38/yb-stress-sample-apps-1.1.38.jar

./bin/yb-ctl create --timeout-yb-admin-sec 180 --rf 3
/opt/jdk-17/bin/java -jar $HOME/tmp/yb-stress-sample-apps-1.1.38.jar --workload SqlCrossDBLoadWithDDL --num_of_tables_in_db 1 --num_writes -1 --num_reads -1 --num_threads_write 3 --num_threads_read 3 --num_unique_keys 2000000000000000 --num_value_columns 30 --use_datatypes true --nodes 127.0.0.1:5433,127.0.0.2:5433,127.0.0.3:5433 --username yugabyte --batch_size 3 --num_of_non_colocated_databases 1 --num_of_colocated_databases 0 --num_of_parallel_ddls 1 --per_db_catalog_mode false >& ~/tmp/global.out

The test output is saved in the file ~/tmp/global.out.

@jasonyb
Copy link
Contributor

jasonyb commented Nov 22, 2024

Possibly related issues: #25062, #25064

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/high High Priority qa_stress Bugs identified via Stress automation QA QA filed bugs
Projects
None yet
Development

No branches or pull requests

8 participants