-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli/dump: cockroach dump
produces unrestorable output for CREATE TABLE
statements with interleaved indices
#35462
Comments
Zendesk ticket #3068 has been linked to this issue. |
This issue is referenced from the documentation as a workaround for fixing interleaved Is there a workaround or alternate solution for interleaved tables? (I should clarify that the problem exists with |
I think @jordanlewis is already working on this in #38317 ? |
I was, but I don't have bandwidth to finish that work right now. It needs more testing still. If @tyler314 wants to pick this up, I'm completely okay with that. |
@tyleroberts I think we can move all the index creation statements to the end like @mjibson suggested -- for IMPORT I think it won't matter and for regular insert, I think it might be faster than making every INSERT do index writes. |
Fix bug where dump would include INTERLEAVE IN PARENT statements inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go, and included the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT statements inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT statements for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT statements for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT statements for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT statements for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT statements for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT clauses for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE clauses themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE clauses to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
Fix bug where dump would include INTERLEAVE IN PARENT clauses for indexes inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE clauses themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE, for the create_nofk columns. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go for the create_nofk columns, and includes the additon of adding the INTERLEAVE clauses to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: cockroachdb#35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements.
39486: sql: dump puts INTERLEAVE statements outside of CREATE TABLE statements r=tyleroberts a=tyleroberts Fix bug where dump would include INTERLEAVE IN PARENT statements inside of CREATE TABLE statements. CRDB currently does not support this, thus forcing the user to manually edit the dump files to remove the INTERLEAVE statements themselves. Previousily, crdb_internal.go would use show_create.go to create the SHOW CREATE TABLE statements which would include INTERLEAVE. crdb_internal.go would also add ALTER STATEMENTs separately to the alter_statements of the create statements of the table. This change removes the addition of the INTERLEAVE within show_create.go, and included the additon of adding the INTERLEAVE statements to the alter_statements within crdb_internal.go. A bug was also fixed in structured.go in the SQLString method that created the SQL string out of order when a non-empty table name is passed in. The bug caused the "ON tablename" to be printed before the index and without space in between the two. Resolves: #35462 Release Note (bug fix): dump now works properly when handling INTERLEAVED tables, printing them outside of CREATE TABLE statements. 39763: sql: quieter TestFuncNulls r=dt a=dt Before this was running every combination of builtin func and type as a separate, named subtest. It is unlikely we need such granular ability to run just one combination (the test runs <1s), while generating so many named substests resulted in 5655 lines / 400kb of test output. Removing the subtest cuts this to about 140 lines / 14kb (there are some stacktraces logged). Release note: none. 39764: pgwire: make TestEncodings quieter r=dt a=dt The creation of named subtests for every combination of test-case and parameters meant this test was creating over 1k named tests. Along with test logging, that meant this one test was emitting over 400kb of output. Additionally this meant this one test was contributing a non-trivial fraction of our overall total named tests that pass/fail individually, are tracked over time, etc. The hyper-granularity here isn't buying us much vs the extra overhead. This change inverts the loop vs subtests, making hand-defined subtests for encode and decode of each format, each of which then check all the test cases. Release note: none. Co-authored-by: Tyler314 <tyler@cockroachlabs.com> Co-authored-by: David Taylor <tinystatemachine@gmail.com>
Interleaved indices can't be added as part of a
CREATE TABLE
statement; this is a known limitation tracked by #9148. However,cockroach dump
is unaware of this limitation: if you dump a table with an interleaved index, the index is emitted inline in theCREATE TABLE
. This produces dump files that can't be restored without manual editing.In the past we've made changes to
ShowCreateTable
and thecrdb_internal
table to produce usableCREATE TABLE
statements in dumps (see 65c0bfb). To solve this issue we either need to fix the root cause (#9148) or make another change to the dump logic to add interleaved indices after table creation instead of in theCREATE TABLE
.Relates to #28948 (master issue of
cockroach dump
inadequacies).The manual edit you have to make: change
into
Full repro on a 19.1 build:
Repro steps
The text was updated successfully, but these errors were encountered: