-
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
[DocDB] splitting: Disable tablet splitting for tablets with incorrectly persisted data #12189
Labels
area/docdb
YugabyteDB core features
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Comments
arybochkin
added
area/docdb
YugabyteDB core features
status/awaiting-triage
Issue awaiting triage
labels
Apr 18, 2022
rthallamko3
added
priority/critical
Critical issue
and removed
status/awaiting-triage
Issue awaiting triage
labels
Apr 20, 2022
arybochkin
added a commit
that referenced
this issue
May 15, 2022
…ith range partitioning Summary: Issue #12190 gives a potential data loss, a temporary disabling for both dynamic and manual splitting for index tables with range partitioning is required at master server side. When #12190 and #12191 are done tablet splitting should be enabled for those tables. Additional tablet splitting disabling is added at tablet server side, other checks and cases will be covered in #12189. Additionally, an index versioning support is implemented by adding a new field `partition_key_version` into schema's `TableProperties` and `TablePropertiesPB` -- the default version should be updated in the context of #12190, after that tablet splitting becomes enabled automatically for index tables with range partitioning. Test Plan: Main: 1. unit test: ybd --cxx-test pgwrapper_pg_tablet_split-test --gtest_filter "PgTabletSplitTest.ManualSplitIndexTablet" 2. manual test: 2.1) create a cluster ``` ./bin/yb-ctl create --master_flags="enable_automatic_tablet_splitting=true,\ tablet_split_low_phase_shard_count_per_node=16,\ tablet_split_low_phase_size_threshold_bytes=13421" \ --tserver_flags="yb_num_shards_per_tserver=1" ``` 2.2) run `./bin/ysqlsh` and execute ``` create table employees(id int primary key, name text, description text); create index idx1 on employees(description ASC); ``` 2.3) open tablet server web ui and make sure only one tablet exists for index table 2.4) download `collect_insert_data.txt` from #10926 and rename to `collect_insert_data.py` 2.5) execute `./collect_insert_data.py` to generate sql script 2.6) execute `./bin/ysqlsh -f sql_data.sql` 2.7) make sure only one tablet still exists for index table, while the table has several tablets 2.8) flush `idx1` index tablet: `./bin/yb-ts-cli flush_tablet <UUID>` 2.9) try manual split: `./bin/yb-admin split_tablet -master_addresses localhost:7100 <UUID>` the following error should appear: ``` Error running split_tablet: Not implemented (yb/master/tablet_split_manager.cc:176): Unable to start split of tablet <UUID>: Tablet splitting is not supported for the index table "idx1" with table_id "000033e5000030008000000000004005". Please, rebuild the index! ``` 3. Additional tests should not give unexpected results: ybd --cxx-test tablet_tablet-split-test ybd --cxx-test integration-tests_tablet-split-itest ybd --cxx-test integration-tests_tablet_server-itest ybd --cxx-test integration-tests_cql-tablet-split-test ybd --cxx-test integration-xcluster-tablet-split-itest ybd --cxx-test common_schema-test --gtest_filter TestSchema.TestSchema ybd --cxx-test common_schema-test --gtest_filter TestSchema.TestCreateProjection ybd --cxx-test master_catalog_manager-test --gtest_filter "TestCatalogManager.CheckIfCanDeleteSingleTablet" ybd --cxx-test pgwrapper_pg_tablet_split-test --gtest_filter "PgTabletSplitTest.SplitDuringLongRunningTransaction" ybd --cxx-test pgwrapper_pg_mini-test --gtest_filter "PgMiniTest.TabletSplitSecondaryIndexYSQL" Reviewers: timur, rthallam Reviewed By: timur, rthallam Subscribers: zyu, ybase, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D16738
arybochkin
added a commit
that referenced
this issue
Jun 7, 2022
… index tables with range partitioning Summary: Issue #12190 gives a potential data loss, a temporary disabling for both dynamic and manual splitting for index tables with range partitioning is required at master server side. When #12190 and #12191 are done tablet splitting should be enabled for those tables. Additional tablet splitting disabling is added at tablet server side, other checks and cases will be covered in #12189. Additionally, an index versioning support is implemented by adding a new field `partition_key_version` into schema's `TableProperties` and `TablePropertiesPB` -- the default version should be updated in the context of #12190, after that tablet splitting becomes enabled automatically for index tables with range partitioning. Original commit: 2ef55c8 / D16738 Test Plan: Main: 1. unit test: ybd --cxx-test pgwrapper_pg_tablet_split-test --gtest_filter "PgTabletSplitTest.ManualSplitIndexTablet" 2. manual test: 2.1) create a cluster ``` ./bin/yb-ctl create --master_flags="enable_automatic_tablet_splitting=true,\ tablet_split_low_phase_shard_count_per_node=16,\ tablet_split_low_phase_size_threshold_bytes=13421" \ --tserver_flags="yb_num_shards_per_tserver=1" ``` 2.2) run `./bin/ysqlsh` and execute ``` create table employees(id int primary key, name text, description text); create index idx1 on employees(description ASC); ``` 2.3) open tablet server web ui and make sure only one tablet exists for index table 2.4) download `collect_insert_data.txt` from #10926 and rename to `collect_insert_data.py` 2.5) execute `./collect_insert_data.py` to generate sql script 2.6) execute `./bin/ysqlsh -f sql_data.sql` 2.7) make sure only one tablet still exists for index table, while the table has several tablets 2.8) flush `idx1` index tablet: `./bin/yb-ts-cli flush_tablet <UUID>` 2.9) try manual split: `./bin/yb-admin split_tablet -master_addresses localhost:7100 <UUID>` the following error should appear: ``` Error running split_tablet: Not implemented (yb/master/tablet_split_manager.cc:176): Unable to start split of tablet <UUID>: Tablet splitting is not supported for the index table "idx1" with table_id "000033e5000030008000000000004005". Please, rebuild the index! ``` 3. Additional tests should not give unexpected results: ybd --cxx-test tablet_tablet-split-test ybd --cxx-test integration-tests_tablet-split-itest ybd --cxx-test integration-tests_tablet_server-itest ybd --cxx-test integration-tests_cql-tablet-split-test ybd --cxx-test integration-xcluster-tablet-split-itest ybd --cxx-test common_schema-test --gtest_filter TestSchema.TestSchema ybd --cxx-test common_schema-test --gtest_filter TestSchema.TestCreateProjection ybd --cxx-test master_catalog_manager-test --gtest_filter "TestCatalogManager.CheckIfCanDeleteSingleTablet" ybd --cxx-test pgwrapper_pg_tablet_split-test --gtest_filter "PgTabletSplitTest.SplitDuringLongRunningTransaction" ybd --cxx-test pgwrapper_pg_mini-test --gtest_filter "PgMiniTest.TabletSplitSecondaryIndexYSQL" Reviewers: rthallam, timur Reviewed By: rthallam, timur Subscribers: bogdan, ybase Differential Revision: https://phabricator.dev.yugabyte.com/D17001
arybochkin
added
priority/high
High Priority
and removed
priority/critical
Critical issue
labels
Jul 7, 2022
@arybochkin , Can we close this now? |
yugabyte-ci
added
kind/enhancement
This is an enhancement of an existing feature
and removed
kind/bug
This issue is a bug
labels
Nov 1, 2022
We cannot close. Sanity checks are required for issue, all possible unit test have already been added in the context of #12190. |
Reopening for adding sanity checks. |
yugabyte-ci
added
priority/medium
Medium priority issue
and removed
priority/high
High Priority
labels
Feb 23, 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/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Jira Link: DB-1991
The following cases should be handled at tablet server side:
GetSplitKey()
/GetEncodedMiddleKey()
a new error code must be returned to identify such tablets for indexes recreation after YBOperation.partition_key encoding issue is fixedStep to reproduce the issue:
enable_automatic_tablet_splitting=true
:1.1. Create a table and a unique index
Tablets info after statements have been executed:
1.2. Insert a row with a value that matches partition bounds
YBOperation is forwarded to the first tablet
d75c1be78e94456d9803758d6650a897
asYBOperation.partition_key
is less than the second partition lower bound:537000000021
<5370000021
. But the operation should have been forwarded to the second tablet in accordance with range bounds. Tablets dump confirms the inserted row is persisted in the first tablet (with respect to DocDB format):2.1.
./bin/ysqlsh
and create a table and a unique index:2.2. mv collect_insert_data.txt to
collect_insert_data.py
and runpython ./collect_insert_data.py
2.3.
./bin/ysqlsh -f sql_data.sql
2.4. Wait for the data to be loaded
Expected result: only 10 records are loaded
Actual result: the record that matches partition bound is duplicated, the following can be observed:
The text was updated successfully, but these errors were encountered: