Closed Arjun-yb closed 1 year ago
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.
Closing this as it is expected behaviour with older version's backup
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:
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;
{ "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" }
{ "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" }