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] [Tablet Splitting] Automatic tablet splitting is not happening for the range indexes(which are restored from backup) #17169

Closed
1 task done
Arjun-yb opened this issue May 4, 2023 · 2 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/high High Priority tablet-splitting

Comments

@Arjun-yb
Copy link
Contributor

Arjun-yb commented May 4, 2023

Jira Link: DB-6444

Description

Automatic tablet splitting is not happening for the range indexes(which are restored from backup)

Version: 2.18.0.0-b31

Steps:

  1. Create universe in 2.8.12
  2. Create tables and indexes(hash and range)
CREATE DATABASE backup_restore_ysql_db;

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TYPE complex AS (re float8, im float8);
CREATE DOMAIN postal_code AS TEXT CHECK(VALUE ~ '^\d{5}$'OR VALUE ~ '^\d{5}-\d{4}$');
CREATE TYPE e_details AS ENUM ('Email', 'Sms', 'Phone');

CREATE TABLE bkup_restore_ysql_table_hash(id text, uuid_col uuid DEFAULT uuid_generate_v4 (), name text, c complex, info json, contact JSONB, arr smallint[], cash money, i inet, m macaddr, i2 serial, i3 bigserial, val smallint, details e_details, age int, collated_data text, date DATE, n NUMERIC (3, 2), r real, c1 CHAR(1), created_at timestamptz, uuid0 uuid DEFAULT uuid_nil(), uuid1 uuid DEFAULT uuid_generate_v1(), p1 POINT, t1 TIME, ts1 TIMESTAMP, i4 INTERVAL, p2 path, p3 polygon, b box, c2 circle, l line, l1 lseg, a2 text[][], zip postal_code, PRIMARY KEY(id));

CREATE TABLE bkup_restore_ysql_table_range(id text, uuid_col uuid DEFAULT uuid_generate_v4 (), name text, c complex, info json, contact JSONB, arr smallint[], cash money, i inet, m macaddr, i2 serial, i3 bigserial, val smallint, details e_details, age int, collated_data text, date DATE, n NUMERIC (3, 2), r real, c1 CHAR(1), created_at timestamptz, uuid0 uuid DEFAULT uuid_nil(), uuid1 uuid DEFAULT uuid_generate_v1(), p1 POINT, t1 TIME, ts1 TIMESTAMP, i4 INTERVAL, p2 path, p3 polygon, b box, c2 circle, l line, l1 lseg, a2 text[][], zip postal_code, PRIMARY KEY(id ASC));

CREATE INDEX hash_table_range_secondary_idx ON bkup_restore_ysql_table_hash(name ASC);
CREATE UNIQUE INDEX hash_table_range_unique_idx ON bkup_restore_ysql_table_hash(name ASC, age DESC, created_at ASC);
CREATE INDEX hash_table_hash_partial_idx ON bkup_restore_ysql_table_hash(name, age, uuid_col) WHERE age>10;

CREATE INDEX range_table_hash_secondary_idx ON bkup_restore_ysql_table_range(name);
CREATE UNIQUE INDEX range_table_hash_unique_idx ON bkup_restore_ysql_table_range(name, age, created_at);
CREATE INDEX range_table_range_partial_idx ON bkup_restore_ysql_table_range(name ASC, age DESC, uuid_col DESC) WHERE age>10;
  1. Load 100K rows and take backup
  2. Create universe in 2.18 with below GFLAGs
    Master:
{
  "enable_automatic_tablet_splitting": "true",
  "tablet_split_high_phase_shard_count_per_node": 500,
  "tablet_split_high_phase_size_threshold_bytes": 51200,
  "tablet_split_low_phase_size_threshold_bytes": 5120,
  "tablet_split_low_phase_shard_count_per_node": 16,
  "tablet_split_limit_per_table": 512,
  "enable_stream_compression": "true",
  "stream_compression_algo": 3,
  "ysql_enable_packed_row": "true"
}

Tserver:

{
  "enable_automatic_tablet_splitting": "true",
  "yb_num_shards_per_tserver": 1,
  "ysql_num_shards_per_tserver": 1,
  "enable_stream_compression": "true",
  "stream_compression_algo": 3,
  "scheduled_full_compaction_frequency_hours": "12",
  "scheduled_full_compaction_jitter_factor_percentage": "100",
  "scheduled_full_compaction_check_interval_min": "5",
  "ysql_enable_packed_row": "true"
}
  1. Restore backup in 2.18 universe and check the tablets of tables and indexes

Observations:

  1. Tablets splitting is not happing for range indexes(which are restored from the backup)
  2. Splitting is not happening even if we load some more data to the tables.
  3. If user creates new range indexes(with same schema as is previous range indexes) tablet splitting is happening for the newly created range indexes.

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

  • I confirm this issue does not contain any sensitive information.
@Arjun-yb Arjun-yb added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels May 4, 2023
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 4, 2023
@yugabyte-ci yugabyte-ci added priority/high High Priority and removed priority/medium Medium priority issue labels May 4, 2023
@arybochkin
Copy link
Contributor

This is an expected behaviour for the backups taken before 2.14.5.0-b8 as this is the earliest release which contains the fix that supports partition key corrected algo and partition key version parameter.
If the backup is taken before 2.14.5.0-b8 and is restored to any release ≥ 2.14.5.0-b8 then tablet splitting for range-partitioned index tables is disabled for restored index tables to avoid data inconsistency. Newly created index tables are fine with tablet splitting (an partitioning_version is set to 1 for them).
@Arjun-yb, the issue can be closed but if you want you may re-check with a backup from a build ≥ 2.14.5.0-b8. I believe this was tested a lot of times already.

@Arjun-yb
Copy link
Contributor Author

Arjun-yb commented May 5, 2023

Closing this as it is expected behaviour with older version's backup

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 tablet-splitting
Projects
None yet
Development

No branches or pull requests

4 participants