-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[colocation] Corruption when dropping indexed table with backfill #4986
Comments
This appears to be because pgtableid is not set for the |
jaki
added a commit
that referenced
this issue
Jul 8, 2020
Summary: `pgtable_id` for schemas are not set consistently for master metadata and tserver metadata. - Create table request from postgres does not set it - `CatalogManager::CreateTable` does not set it - `RaftGroupMetadata::AddTable` does set it - `CatalogManager::AlterTable` does set it - `CatalogManager::AddIndexInfoToTable` does not set it - `CatalogManager::MarkIndexInfoFromTableForDeletion` does not set it - `RaftGroupMetadata::SetSchema` does not set it Ideally, `pgtable_id` would be set into the master schema on create, either on the create table request from postgres or `CatalogManager::CreateTable`. However, this may cause backwards compatibility issues. For now, tackle this problem at `RaftGroupMetadata::SetSchema` by setting `pgtable_id` there. This is just a copy-paste from `RaftGroupMetadata::AddTable`. Ideally, both shouldn't have to do this because the master schema would already have it. Test Plan: ```sh ./bin/yb-ctl create \ --master_flags "ysql_disable_index_backfill=false" \ --tserver_flags "ysql_disable_index_backfill=false" ./bin/ysqlsh ``` ```sql CREATE TABLE t (i int); CREATE INDEX ON t (i); DROP INDEX t_i_idx; DROP TABLE t; -- no corruption from docdb ``` ```sh # Set `ysql_disable_index_backfill` default to false in the code, then ./yb_build.sh \ --cxx-test pgwrapper_pg_libpq-test \ --gtest_filter PgLibPqTest.TableColocation ``` Reviewers: neha Reviewed By: neha Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D8834
jaki
added a commit
that referenced
this issue
Jul 8, 2020
Summary: `pgtable_id` for schemas are not set consistently for master metadata and tserver metadata. - Create table request from postgres does not set it - `CatalogManager::CreateTable` does not set it - `RaftGroupMetadata::AddTable` does set it - `CatalogManager::AlterTable` does set it - `CatalogManager::AddIndexInfoToTable` does not set it - `CatalogManager::MarkIndexInfoFromTableForDeletion` does not set it - `RaftGroupMetadata::SetSchema` does not set it Ideally, `pgtable_id` would be set into the master schema on create, either on the create table request from postgres or `CatalogManager::CreateTable`. However, this may cause backwards compatibility issues. For now, tackle this problem at `RaftGroupMetadata::SetSchema` by setting `pgtable_id` there. This is just a copy-paste from `RaftGroupMetadata::AddTable`. Ideally, both shouldn't have to do this because the master schema would already have it. Test Plan: ```sh ./bin/yb-ctl create \ --master_flags "ysql_disable_index_backfill=false" \ --tserver_flags "ysql_disable_index_backfill=false" ./bin/ysqlsh ``` ```sql CREATE TABLE t (i int); CREATE INDEX ON t (i); DROP INDEX t_i_idx; DROP TABLE t; -- no corruption from docdb ``` ```sh # Set `ysql_disable_index_backfill` default to false in the code, then ./yb_build.sh \ --cxx-test pgwrapper_pg_libpq-test \ --gtest_filter PgLibPqTest.TableColocation ``` Reviewers: neha Reviewed By: neha Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D8834
Closed by commit d92b234. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see
ERROR: Corruption: Unable to decode key prefixes from: 21
when dropping a colocated table that has/had indexes with backfill enabled.Useful logs:
This causes
PgLibPqTest.TableColocation
to fail when backfill is enabled by default.The text was updated successfully, but these errors were encountered: